<< Click to Display Table of Contents >> Navigation: »No topics above this level« Configuration file |
This section contains a detailed description of the Modbus configuration file format, in case it must be created manually or by another automated process and the Fieldbus Designer cannot be used.
In order for a configuration file to be created manually, additional documents from the following list may be required.
•X20BC0087 Bus Connector User's Manual
•User's Manuals for the X20 modules used
The following description refers to Version 2 of the configuration format. The previous version can still be read by the line, however it doesn't contain any configuration data, and is therefore no longer described in detail. The Version attribute must be set to 2, since the line will otherwise assume Version 1 and be unable to interpret the file.
The configuration contains a <Stations> element with which 1 - 239 station configurations can be nested.
Example of a configuration file:
<ModbusPVIVersion="2"> <Stations>
Station description 1 <!-- Section for the first station --> Station description 2 <!-- Section for the second station --> ...... Station description n <!-- Section for the nth station -->
</Stations> </ModbusPVI> |
The station description contains all the parameters for a Modbus node. The description consists of the configuration data and the variable mapping.
The <Station> element can have the following attributes:
•DAIP specifies the IP address or hostname of the device to which this station configuration is assigned.
•PN (optional) defines the port number on which the Modbus bus connector waits for connection requests. If this value is not specified, the default Modbus port 502 is used.
Example of a station description:
<StationDAIP="10.43.150.11"PN="502">
</Station> |
The station configuration contains the system parameters for the bus connector and the module configuration.
The <Configuration> element can have the following attributes:
•CheckSum contains the checksum for the configuration data in this section. This line uses this checksum to determine the need to transfer the configuration. The FieldbusDESIGNER calculates this checksum using the CRC32 algorithm and the polynomial 0xedb8832 with recursive inclusion of all the attributes of all subordinate elements. Any custom implementation must ensure that changes to the configuration data also result in a change to the checksum in order for the configuration to actually be sent to the bus connector. The checksum can be entered as a decimal or hexadecimal value with a leading "0x".
Example of a station configuration:
<ConfigurationCheckSum="0x31cdba6">
</Configuration> |
This section contains the system parameters of the bus connector, which are stored in the flash memory. If the file is created with the FieldbusDESIGNER, this section contains the parameters that are set on the configuration page of the bus connector. The list of all available system parameters and their addresses, data types, and possible values can be found in the description of the X20BC0087 bus connector.
All system values are nested in a <SystemValue> element. The <SystemValue> element has no attributes.
The following list describes the attributes to be entered for a <SystemValue> element:
•RO defines the runtime object's name. The Register ID is used for this name.
•RA is the address of the register on the bus controller. This value can be entered as a decimal or hexadecimal value with a leading "0x".
•VT is the data type of the parameter. The following table lists the possible data types of a system parameter.
ou16 for a 2 byte unsigned integer
ou32 for a 4 byte unsigned integer
•Value defines the value that must be written to the register on the bus controller.
Example of a list of system parameters:
<SystemValues> <SystemValueRO="TcpLifeTime"RA="0x01010"VT="u16"Value="30"/> <SystemValueRO="MTU"RA="0x01011"VT="u16"Value="1500"/> <SystemValueRO="WatchdogMode"RA="0x01043"VT="u16"Value="0xC0"/> <SystemValueRO="X2XBusConfig"RA="0x01012"VT="u16"Value="0xC0"/> <SystemValueRO="IoAddressCheck"RA="0x01182"VT="u16"Value="0xC1"/> <SystemValueRO="ModuleInitDelay"RA="0x01181"VT="u16"Value="0"/> </SystemValues> |
This section contains the module parameters and the configuration of the module register of all the modules.
Example of a module configuration:
<ModuleConfig>
<Modules> Parameter module 1 <!-- Parameter list for module 1 --> Parameter module 2 <!-- Parameter list for module 2 --> ...... Parameter module n <!-- Parameter list for module n --> </Modules>
<RegisterConfigs> Register configuration 1 <!-- Register configuration 1 --> Register configuration 2 <!-- Register configuration 2 --> ...... Register configuration n <!-- Register configuration n --> </RegisterConfigs>
</ModuleConfig> |
This section defines the parameters of an individual module. A <Parameter> element is created for each parameter. All module parameters are nested in a <Module> element.
The <Module> element can have the following attributes:
•ST defines the slot where the module is located. The value of this attribute must be between 1 - 239, and must be unique within a module parameter section.
The <Parameter> element can have the following attributes:
•RO is given the name of the parameter.
•RA defines the address of the parameter.
•VT is the data type of the parameter. The following data types are permitted for a module parameter.
ou16 for a 2 byte unsigned integer
ou32 for a 4 byte unsigned integer
•Value defines the value of the parameter.
For a list of available module parameters, detailed descriptions of them, and their possible values, see the description of the X20BC0087 bus connector. The following parameters must be defined in this section:
•ProductCode defines the ID of the module expected in this slot. The product codes can be found in the descriptions of the individual modules. This value can be entered as a decimal or hexadecimal value with a leading "0x". If this parameter is set to 0, there is no check whether the correct module is connected.
•FunctionModel defines the function model in which the module will be operated. The function models of a module can also be found in the descriptions of the respective modules.
•ConfigIndex is the reference to the start address of the module's register configuration. Permitted values range from 0xC000 to 0xDFFF. The values can also be entered in decimal format.
•ConfigLength is the number of entries in the register configuration for this module.
Example of a list of module parameters:
<ModuleST="1"> <ParameterRO="ProductCode"RA="0x0A008"VT="u16"Value="8076"/> <ParameterRO="FunctionModel"RA="0x0A009"VT="u16"Value="0"/> <ParameterRO="ConfigIndex"RA="0x0A00A"VT="u16"Value="0x0C000"/> <ParameterRO="ConfigLength"RA="0x0A00B"VT="u16"Value="1"/> </Module> |
This section defines a register configuration for one or more modules. A <Register> element is created for each register configured. These elements are nested in a <RegisterConfig> element.
The <RegisterConfig> element must have the following attributes:
•ConfigIndex defines the start address for this configuration on the bus connector. The corresponding module parameter references this address. If more than one module has the same register configuration, each of them can reference the same configuration area.
A more detailed description of the available registers and their configuration can be found in the descriptions of the respective modules.
The <Register> element can have the following attributes:
•Number defines the register number (address). This value can be entered as a decimal or hexadecimal value with a leading "0x".
•Type defines the register type. The following register types are permitted:
o0 ... Dynamic cyclic input
o1 ... Dynamic cyclic output
o2 ... Fixed cyclic input
o3 ... Fixed cyclic output
o4 ... Acyclic input
o5 ... Acyclic output
•Size defines the size of the register in bytes. The values 1, 2 and 4 are permitted.
•Value defines the starting value that must be written to the register in this configuration.
Example of a list of register configurations:
<RegisterConfigConfigIndex="0x0C004"> <RegisterNumber="0"Type="3"Size="1"Value="0"/> <RegisterNumber="1"Type="3"Size="1"Value="0"/> <RegisterNumber="1"Type="2"Size="1"Value="0"/> <RegisterNumber="2"Type="2"Size="1"Value="0"/> </RegisterConfig> |
This section defines all the modules to which variables are mapped. This mapping takes place in a separate section to maintain a strict distinction from the module configuration and prevent the variables from affecting the checksum. All modules with mapped variables are nested in a <VariableAssignment> element.
The <VariableAssignment> element has no attributes.
Example of a mapping list:
<VariableAssignment> Module 1 <!-- Assignments for module 1 --> Module 2 <!-- Assignments for module 2 --> ...... Module n <!-- Assignments for module n -->
</VariableAssignment> |
This section defines all the registers of a module to which variables are mapped. All registers are nested in a <Module> element.
The <Module> element requires the following attributes:
•Hardware (optional) with the hardware name of the module
•ST with the slot number of the module. The value 0 stands for the bus connector and 1- n for the module connected to it.
Example of a mapping list for a module:
<ModuleHardware="X20DO6529"ST="2"> Register 1 <!-- Assignments for register 1 --> Register 2 <!-- Assignments for register 2 --> ...... Register n <!-- Assignments for register n --> </Module> |
This section defines the mapping of variables to an individual register. A <Variable> element is created for each mapping. These mappings are nested in a <Register> element.
The <Register> element requires the following attributes:
•ID for unique identification of a register within a module. The FieldbusDESIGNER takes this value from the runtime configuration. For files that were created manually or using other methods, this value can simply be incremented or set with the register address.
•RT defines the register type. The line supports the following register types:
o1 ... Dynamic cyclic
o2 ... Fixed cyclic
o3 ... Acyclic
o4 ... Pseudocyclic
o5 ... Info register for constant values that only need to be read by the module once, and are then saved in the line.
o6 ... ModuleOk Flag
•Value defines the start value of the register. This value is usually the same as the value defined in the register configuration. This value only has meaning for bit access to acyclic and pseudocyclic registers, since in these cases the current value is always needed in order to prevent read access so that the value to be written can be determined.
Each <Variable> element can have the following attributes:
•RA defines the address of the register. This value can be entered as a decimal or hexadecimal value with a leading "0x". The available address areas and their meaning can be found in the description of the bus connector. For register types 3 and 4, the address of the module register is entered here directly.
•VT defines the data type of the variable. The line checks whether the specified data type is permitted for the respective address. The following data types are possible for a variable:
oBoolean for digital channels
ou8 for an unsigned byte channel
oi8 for a signed byte channel
ou16 for an unsigned 2 byte channel
oi16 for a signed 2 byte channel
ou32 for an unsigned 4 byte channel
oi32 for a signed 4 byte channel
•VN (optional) defines the number of elements in an array. If an array is defined, it can be accessed with Name[index].
•AT defines a variable's PVI attribute. The line checks whether an attribute is permitted for the respective address area, and if necessary produces a corresponding error message. A list of attributes possible for variables can be found in the PVI documentation. In most cases, however, "r" for inputs and "rw" for outputs is sufficient.
•Flags (optional) to define additional options for the variable. Possible flags include:
o"s" for single variables, which can only be accessed with a single register function. Required for special control registers of the bus connector.
•Bit (optional) defines the bit offset of a digital channel within the assigned register. This is only relevant for register types 3 and 4.
•RO defines the symbolic name that must be specified by the application when creating a variable.
Example of a mapping list for a register: