<< 点击显示目录 >> 主页
mappServices帮助手册 > mapp IO 管理硬件配置 > 概念 Modules |
"Module" 在配置中定义一个新模块。这可能包括模块配置和 IO 映射。如果模块被导入,其接口属性也会被导入。也就是说,如果模块使用了某个接口,它就会被自动导入。
•Attributes
•ID: 定义模块导入后的连接地址/接口(如 "IF6.ST1")。
•Hardware: I/O 模块的唯一标识字符串(如 "X20DI9371")。
•SourceName: 引用配置中模块的名称(如 "MyModule")。"SourceName "可代替 "Hardware"。
•SourceID: 定义引用配置中模块的地址/接口(如 "IF6.ST7")。
•Source: 可选择使用该属性。定义模块配置的位置(如 "AR")。
•ImportMode: 该属性的使用是可选的。定义模块的导入方式(如 "ModuleOnly")。
导入模块时可能需要定义其他参数。例如,在某些 AO 模块中,必须指定上限或下限。如何或是否必须定义这些参数,可通过文件 "arconfig.br "确定。添加所需的模块并编译项目。可在文件 "arconfig.br "中检查这些参数。
例如
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceName="MyInputModule" ImportMode="ModuleOnly" />
<Module ID="IF6.ST1.IO">
<LN ID="DigitalInput01" DPName="diInput1" />
</Module>
<Module ID="IF6.ST2" Source="AR" SourceName="MyOutputModule" >
<LN ID="DigitalOutput01" DPName="doOutput1" />
</Module>
</IOCFG>
在本例中,元素 "LN "用于调整 IO 映射。有关其他信息,请参阅 此处。
$root "语句用于将主配置信息复制到导入文件。这样,主配置中的模块就可以在导入文件中使用。
id 定义了模块在硬件拓扑中的位置。
[SL<slotnr>][.SS<sslnr>] [[.IF<ifnr>.ST<stanr>][.SL<staslotnr>][.SS<stasslnr>]].<chnr>
Attribute |
Description |
slotnr |
插槽编号 |
sslnr |
子插槽编号 |
ifnr |
接口编号 |
stanr |
节点编号 |
staslotnr |
站点插槽编号 |
stasslnr |
站子插槽编号 |
chnr |
通道编号 |
例如
<Module ID="IF6.ST1" Hardware="X20DI9371" />
<Module ID="IF3.ST1.IF1.ST2" Hardware="X20DO9322" />
本例中添加了以下标为红色的模块:
模块的唯一标识。有关标识字符串,请参阅模块的帮助文档。
引用配置中硬件模块的名称。如果模块在 AS 配置中已命名,则可使用此名称。取代 "硬件 "属性。
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceID="IF6.ST3" />
</IOCFG>
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceName="OutputModule01" />
</IOCFG>
可使用 "Hardware(硬件)"或 "SourceName(源名称)"代替 "SourceID(源 ID)"。
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceID="IF6.ST2" />
</IOCFG>
"Source" 定义模块配置的位置。默认值为 "AR"。
AR: 使用主配置中的配置。
Template: 使用模板文件中的配置 。
<Module ID="IF3.ST1" Source="Template" SourceName="DI2377" />
本例中创建了名为 "DI2377 "的模板文件。要了解如何使用模板文件,请参阅 模板文件部分 。
该参数为可选参数。下面的示例使用不同的导入模式导入 AR 配置中已有的模块 8BVI0014HCSS.000-1。 如果未指定 "ImportMode",则始终使用ModuleWithSubslots 。
导入模式可定义如下:
ModuleOnly: 只添加指定的模块。
ModuleWithSubslots: 添加指定模块及其所有子槽。
Branch: 指定模块与所有子槽和子模块一起添加。
如果未指定 ImportMode,则 始终使用ModuleWithSubslots。
"Module" defines a new module in the configuration. This may include a module configuration as and IO mapping. If a module is imported, its interface properties are also imported. This means that if a module uses a certain interface, it is automatically imported.
•Attributes
•ID: Defines the address/interface to which the module is connected after import (e.g. "IF6.ST1").
•Hardware: Unique identification string of the I/O module (e.g. "X20DI9371").
•SourceName: Name of the module in the referenced configuration (e.g. "MyModule"). "SourceName" can be used instead of "Hardware".
•SourceID: Defines the address/interface of the module in the referenced configuration (e.g. "IF6.ST7").
•Source: This attribute can be used optionally. Defines where the configuration of the module is located (e.g. "AR").
•ImportMode: The use of this attribute is optional. Defines how the module should be imported (e.g. "ModuleOnly").
Additional parameters may have to be defined when importing modules. In some AO modules, for example, an upper or lower limit must be specified. How or if at all these parameters must be defined can be determined via file "arconfig.br". The desired module is added and the project is compiled. These parameters can be checked in file "arconfig.br".
Example:
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceName="MyInputModule" ImportMode="ModuleOnly" />
<Module ID="IF6.ST1.IO">
<LN ID="DigitalInput01" DPName="diInput1" />
</Module>
<Module ID="IF6.ST2" Source="AR" SourceName="MyOutputModule" >
<LN ID="DigitalOutput01" DPName="doOutput1" />
</Module>
</IOCFG>
In this example, element "LN" is used to adjust IO mapping. For additional information, see here.
The "$root" statement is used to copy the master configuration information to the import file. This allows the modules in the master configuration to be used in the import file.
The ID defines the position in the hardware topology where the module is added. The position of the module is defined as follows:
[SL<slotnr>][.SS<sslnr>] [[.IF<ifnr>.ST<stanr>][.SL<staslotnr>][.SS<stasslnr>]].<chnr>
Attribute |
Description |
slotnr |
Slot number |
sslnr |
Subslot number |
ifnr |
Interface number |
stanr |
Node number |
staslotnr |
Station slot number |
stasslnr |
Station subslot number |
chnr |
Channel number |
Example:
<Module ID="IF6.ST1" Hardware="X20DI9371" />
<Module ID="IF3.ST1.IF1.ST2" Hardware="X20DO9322" />
The following modules marked in red are added in this example:
Unique identification of the module. For the identification string, see the help documentation for the module.
Name of the hardware module in the referenced configuration. This can be used if the module is named in the Automation Studio configuration. Replaces the "Hardware" attribute.
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceID="IF6.ST3" />
</IOCFG>
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceName="OutputModule01" />
</IOCFG>
Defines the address/interface of the module in the referenced configuration. "Hardware" or "SourceName" can be used instead of "SourceID".
<IOCFG xmlns="http://www.br-automation.com/AR/IO" Version="2.0">
<Module ID="$root" Source="AR" SourceID="$root" />
<Module ID="IF6.ST1" Source="AR" SourceID="IF6.ST2" />
</IOCFG>
This parameter can be specified optionally. "Source" defines the location of the module configuration. The default value is "AR".
AR: Configuration from the master configuration is used.
Template: Configuration from the Template files is used.
<Module ID="IF3.ST1" Source="Template" SourceName="DI2377" />
In this example, template files named "DI2377" have been created. To find out how to use template files, see section Template files.
This parameter is optional. The following example imports module 8BVI0014HCSS.000-1, which already exists in the AR configuration, using different import modes. ModuleWithSubslots is always used if "ImportMode" is not specified.
The import mode can be defined as follows:
ModuleOnly: Only the specified module will be added.
ModuleWithSubslots: The specified module is added with all its subslots.
Branch: The specified module is added with all subslots and submodules.
If an ImportMode is not specified, ModuleWithSubslots is always used.