modbusReadBlocks, modbusWriteBlocks
modbusReadBlocks and modbusWriteBlocks elements contain block elements that define the data required for a data group. modbusReadBlocks opens the read block(s) for a data group. modbusWriteBlocks opens the write block(s) for a data group.
This element is:
- Case sensitive
- Not required in a CygNet device template file
- If used, a read and/or write block is used 1 time each per data group
Note: The same register number is not allowed in more than one block in the same data group.
To learn about how this element relates to other elements in a CygNet device template file, see Device Template File Hierarchy.
Example
|
<DateTime niceName="Date and Time" dgCat="dateTime" canSend="true" uccSend="true"> <dgElements byteOrder="bigEndian" secLev="4"> <UnitDate desc="Enron Date" regNum="6076" type="r4"/> <UnitTime desc="Enron Time" regNum="6077" type="r4"/> <DevTm desc="Device Time (Local)" type="r8" cvtRef="TimeEnron" deidDate="UnitDate" deidTime="UnitTime"></DevTm> <HostTm desc="Host Time (Local)" type="r8"/> <DateDiff desc="DateDiff" type="ui4"/> </dgElements> <modbusReadBlocks regByteLen="4"> <block1 regNum="6076" regCnt="2" funcCode="3"/> </modbusReadBlocks> <modbusWriteBlocks regByteLen="4"> <block1 regNum="6076" regCnt="2" funcCode="16"/> </modbusWriteBlocks> </DateTime> |
Attributes
The following table lists and describes attributes generally applicable to this element. However, not all of the attributes listed here are applicable to all EIEs. Additionally, some attributes are required for use in every device template file of a certain EIE, but others may be used on a case-by-case or device-by-device basis, depending on your specific needs. All attributes in templates are case sensitive; but the case sensitivity of attribute values is based on context.
Note: Occasionally, device template files for different EIEs use attributes of the same name that do different things. Efforts are made in this document to highlight cases where an attribute by one name does different things in different EIEs.
| Attribute | Description |
|---|---|
|
regBitLen |
regBitLen specifies the length in bits of each register returned from the device for the specified funcCode. This setting can change from section to section and from register to register in the device. Refer to field device documentation for these settings. Value:
Modbus coil data groups using function code 1, 2, 5, or 15 must use regBitLen, not regByteLen. |
|
regByteLen |
regByteLen specifies the length in bytes of each register returned from the device for the specified funcCode. This setting can change from section to section and from register to register in the device. Refer to field device documentation for these settings. Value:
Modbus coil data groups using function code 1, 2, 5, or 15 must use regBitLen, not regByteLen. |
|
regOff |
regOff defines a register offset that translates a logical register number into a physical register number. It is always used in conjunction with regNum. It may be defined in the same element as regNum, or it may be defined in a parent element then inherited by one or more regNum attributes. regOff enables you to translate Modbus coil/register numbers into data addresses used by field devices. Modbus coil/register numbers are not the same thing as data addresses. For example, the Modbus register number 30001 typically uses the data address 0, which means that you would want to offset a regNum value of 30001 by -30001 in order to return a data address of 0 (or 0x0000). Typical offset constants are as follows:
You must consider the Modbus coil/register range convention you follow and the data addressing convention you follow. In both cases, know the range starting number and the extent of the range. The offset can be determined from the field device manual or register map. Value:
|
|
txMaxRegCnt |
txMaxRegCnt specifies the maximum number of registers that may be communicated in a single transaction. This attribute is optional and intended to provide a way to make messages for a single block smaller than the Modbus maximum message size of 250 data bytes. How many registers you read or write within byte constraints depends on the size of the registers with which you are communicating. txMaxRegCnt is used in conjunction with the regCnt attribute. regCnt specifies the number of registers to be returned in a single block; txMaxRegCnt merely constrains the size of the message(s) used to communicate registers. For example, if you want to retrieve 125 2-byte registers in a single message, set regCnt to 125 and do not use txMaxRegCnt. But if you want to retrieve 125 2-byte registers in five messages, set regCnt to 125 and txMaxRegCnt to 25. Value:
See also block. |


