cardBlocks
cardBlocks elements contain preCard, card, and postCard elements that define the data required for a Modbus DynaCard type.
This element is:
- Case sensitive
- Required in a DynaCard-enabled, Modbus device template file
- Used once per DynaCard type
To learn about how this element relates to other elements in a CygNet device template file, see Device Template File Hierarchy.
See also Modbus EFM EIE Dynagraph Card Data Group.
Example
|
<cardBlocks cardOrdinal="0" surfacePtCount="50" regByteLen="2" funcCode="3" regOff="-40001" txMaxRegCnt="124"> <card cardNum="1" surfacePtCount="200" downholePtCount="200"> <block1 regNum="57201" regCnt="477" cardRep="none"/> <block2 regNum="50001" regCnt="400" cardRep="surface"/> <block3 regNum="50401" regCnt="400" cardRep="surface"/> <block4 regNum="50801" regCnt="400" cardRep="downhole"/> <block5 regNum="51201" regCnt="400" cardRep="downhole"/> </card> <card cardNum="2" cardRep="surface"> <block1 regNum="57201" regCnt="477" cardRep="none"/> <block2 regNum="58401" regCnt="100"/> <block3 regNum="58801" regCnt="100"/> </card> <card cardNum="3" cardRep="surface"> <block1 regNum="57201" regCnt="477" cardRep="none"/> <block2 regNum="58501" regCnt="100"/> <block3 regNum="58901" regCnt="100"/> </card> <postCard> <block6 regNum="60000" regCnt="2"/> </postCard> </cardBlocks> |
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 |
|---|---|
|
cardOrdinal specifies the dynagraph card ordinal a card block represents. The cardOrdinal value must be mapped to a dgOrdinals value. Value:
|
|
|
downholePtCard specifies the number of downhole points (i.e., load-position pairs) to retrieve for a DynaCard. The number of points retrieved affects the precision of the resulting graph. Value:
|
|
|
funcCode specifies the Modbus function code for accessing a register or block of registers. Value:
See Function Codes. |
|
|
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:
|
|
|
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:
|
|
|
surfacePtCard specifies the number of surface points (i.e., load-position pairs) to retrieve for a DynaCard. The number of points retrieved affects the precision of the resulting graph. Value:
|
|
|
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:
|
Function Codes
The following Modbus function codes are supported by CygNet.
| Code | Name | Description |
|---|---|---|
| 1 | Read Coils | Reads contiguous coil statuses from 1 - 2000. Registers must be read-only Boolean. |
| 2 | Read Discrete Inputs | Reads contiguous discrete input statuses from 1 - 2000. Registers must be read/write Boolean. |
| 3 | Read Holding Registers | Reads contiguous contents of a block of holding registers. Registers must be read-only 16 or 32 bit. |
| 4 | Read Input Registers | Reads contiguous input registers from 1 - 125. Registers must be read/write 16 or 32 bit. |
| 5 | Write Single Coil | Writes ON or OFF to a single coil. Registers must be read/write Boolean. |
| 6 | Write Single Register | Writes data to a single holding register. Register must be 16 or 32 bit. |
| 7 | Read Exception Status | Reads the contents of eight exception status outputs in a remote device. |
| 15 | Write Multiple Coils | Writes ON or OFF to multiple coils in sequence. Registers must be Boolean. |
| 16 | Write Multiple Registers | Writes data to a block of contiguous registers from 1 - 123. Registers must be 16 or 32 bit. |


