Supported device types and versions
Communication line configuration
Line protocol parameters
Station configuration
I/O tag configuration
Note on FloBoss 103 device
Note on Honeywell
Literature
Changes and modifications
Document revisions
The protocol implements client (master) communication with arbitrary devices that support MODBUS RTU or MODBUS ASCII standards (serial communication) as well as MODBUS over TCP/IP. Moreover, it supports two extensions:
Forced disconnection: If all stations on the TCP/IP-TCP or TCP/IP-TCP Redundant line are in the simulation mode or the communication is stopped for them, the line will be disconnected (the communication socket will be closed). If the simulation is disabled for at least one station and the communication is not stopped for it (the Parameters tab of the Station type object), the line will be connected again.
A dialog window of communication line configuration - Protocol parameters tab.
They influence some optional protocol parameters.
The line protocol contains the following parameters:
Parameter | Meaning | Unit | Default value |
---|---|---|---|
| The parameter is implemented only for TCP/IP-TCP and TCP/IP-TCP Redundant line categories. The parameter activates the disconnection of the TCP connection after the execution of each read cycle, or after the value is written. The parameter was implemented due to problems with connection stability on mobile GPRS networks. | YES/NO | NO |
| This parameter activates the passive (scanning) mode. In this mode, requests are not sent and writing does not work. Only received packets are parsed. The nature of the Modbus protocol implies that it is necessary to receive both the requests and responses of existing communication. | YES/NO | NO |
| Setting the TCP No Delay parameter to YES causes the low-level socket option TCP_NODELAY to be set, thus turning off the default packet coalesce feature. The parameter is implemented only for TCP/IP-TCP and TCP/IP-TCP Redundant line categories. | YES/NO | NO |
Configuration dialog box - tab Parameter.
They influence some optional parameters of the protocol. The following station protocol parameters can be set:
Table 1
Parameter | Meaning | Unit | Default value |
---|---|---|---|
Maximum count of request retries. If no response returns after a request has been sent, the station's status will change to a communication error. | - | 2 | |
Timeout before resending a request if no response has been received. | s | 0.1 | |
The delay after sending the request and before reading the response. | s | 0.1 | |
The delay between the response readings. | s | 0.1 | |
The maximum number of retries of the response reading. | - | 20 | |
"Start silent interval" before the beginning of the transmission in RTU mode. | ms | 50 | |
"Stop silent interval" after ending of the transmission in RTU mode. | ms | 50 | |
| After writing to the I/O tag, the reading immediately follows. By setting the parameter to the NO value, it is possible to reduce the load on communications (especially serial ones) with a large number of writes. | YES/NO | YES |
| Byte order in Little-endian mode for 4-byte variables. The individual options indicate in which bytes (1-lowest, 4-highest) the individual bytes from the communication will go:
| - | 2143 |
| Special byte mode of transmission in which the values of registers have a length of 1 byte and not 2 bytes as it is defined in Modbus protocol specification. | YES/NO | NO |
Special variable mode of transmission in which the values of registers have variable lengths. The setting of Variable mode: Note 1: Variable and byte modes are incompatible and only one of them can be enabled. | OFF Little endian Big endian | OFF | |
Logging of detailed debug information about communication in the line log. | YES/NO | NO | |
Protocol mode: RTU or ASCII. Note: In the case of "MODBUS over TCP/IP", the parameter value is ignored and Protocol Mode=RTU is used. | RTU ASCII | RTU | |
Sets an address model of MODBUS protocol: MODBUS PDU data are addressed from 0 up to 65535. MODBUS data Model data are addressed from 1 up to 65536. Note: MODBUS PDU is a default value. If the MODBUS data Model is set, the object with the address X is addressed as X-1 in the MODBUS PDU. After you change this parameter, a restart of the respective communication process was required in the past (KOM binaries older than May 27, 2021). | MODBUS PDU MODBUS data Model | MODBUS PDU | |
Select a variant of the protocol in case of TCP/IP communication: "MODBUS TCP" is a variant of communication without control checksum. Safeguarding is done by the underlying TCP protocol. "MODBUS over TCP" is a variant where a payload is MODBUS RTU data containing a checksum. | "MODBUS TCP" "MODBUS over TCP" | "MODBUS TCP" | |
Maximum count of registers that are read by one request. | - | 100 | |
| Maximum count of bytes that are required by one request (only in "Byte mode"). | - | 100 |
| If a value of the integer type (Holding Registers, Input Registers) is assigned to an I/O tag of the Di or Dout type, this is done by comparing the read value with zero. If the value is zero, the value of the I/O tag is False, otherwise True. The Bool Mask parameter allows specific bits to be filtered out before the comparison is made, based on a bitmask specified as a hexadecimal number (the leftmost byte is the highest). The bitmask FF FF FF FF means that all bits are considered (for 1- and 2-register integer addresses). | - | FF FF FF FF |
This parameter is used to avoid reading the values from addresses that are not configured. Description and example: See an example of such communication: | YES/NO | NO | |
| If this parameter is set to YES, then an extra check is performed when receiving a response to a read request: the length of received data is checked whether it matches the number of registers in a read request:
| YES/NO | NO |
| If the parameter is set to YES, then a single request (which contains the total number of registers) is used. It is necessary that the I/O tags are defined for all addresses 0..N. | YES/NO | NO |
| On the TCP/IP-TCP line, immediately after the connection is established, it is possible to write a specific value to the selected address (TCP Password Address) using the selected function (TCP Password Function). In this way, the ComAp control unit enables the authorized Modbus client to be authenticated. The value is entered in hexadecimal in the order of the bytes as they will be transmitted (e.g. "01 0A BC D0". If an odd number of bytes is entered, a byte with the value 0 will be added at the end. Setting the parameter to an empty value causes the write to not be performed after the connection is established. | - | |
| Address for writing the password (TCP Write Password) on the TCP/IP-TCP line. If the password is longer than 2 bytes, it is the address of the first register. If the password has e.g. 6 bytes, written as 3 registers from the specified address. | - | 0 |
| The write function for writing the password (TCP Write Password) on the TCP/IP-TCP line. | 6 16 | 6 |
Possible types of I/O tag values for invariable mode: Ai, Ao, Di, Do, Ci, Co, TxtI.
Possible types of I/O tag values for variable mode: Ai, Ao, Di, Do, Ci, Cout, TxtI, TxtO, TiA.
The main address space in the protocol MODBUS is divided into the following registers:
Independent addressing with the address size of 2 bytes, i.e. addresses from 0 up to 65535 (so-called MODBUS PDU addressing model), is in an address space of each type of register. Some devices work with address space starting with 1 (so-called MODBUS Data Model). In this case, it is necessary to deduct 1 in the address at configuration I/O tags in the D2000 system or change the setting of the parameter Addressing model to the MODBUS data Model.
The I/O tag with an address starting with %IGNORE will be ignored.
I/O tag address can be in a basic or extended format (for a variable mode).
The basic format of I/O tag address:
Address format is [I|U|Uu|Ul|f|F|L|Ll|S|Sl|B|X|sn.|an.|An.][d|D][b][s]RdFn[-WrFn[d]].Address[.BitNr] [,Items] in which:
Modifier s indicates that a status register (Unsigned16) located on address Address is followed by a big-endian Float value located on address Address+1 .. Address+2. This indicator is used for type f and it is implemented for calorimeter Endress+Hauser RMS621. The following table shows the values of the status register and their mapping to D2000 attributes.
Status register | D2000 attributes |
---|---|
0: Invalid value | Weak |
1: Measured value valid | Valid |
2: Overflow warning 3: Overflow error 4: Underflow warning 5: Underflow error 6: Saturated steam alarm 7: Error in differential pressure calculation 8: Wrong medium for DP calculation 9: Wrong value range - DP calculation inaccurate 10: Differential pressure - general error 11: Range overshoot (Tsat > 350 etc.) on 12: Change in state of aggregation 26: Differential pressure --> general error 99: No measured value is assigned to the register in the setup of the ModBus | Weak |
Note on writing: if only a part of the register (lower/higher byte or selected bit) is written and the I/O tag also has RdFn (function for a data reading) configured, then when writing, the value of the entire register is read first, and then the relevant part of the register is modified and the entire register is written.
Note about the byte and register order
1. MODBUS protocol uses the big-endian, i.e. the most significant byte (MSB) is transmitted first. Examples:
Received bytes of MSB-LSB | I/O tag type | Value |
---|---|---|
0x00 0x01 | I, U | 1 |
0xFF 0xFE | I | -2 |
0xFF 0xFE | U | 65534 |
0x01 0x02 | B | 1 |
0x01 0x02 | X | 2 |
2. When values are read from two registers as big-endian the received bytes are analyzed in this way:
Most significant register (ADR address) | Least significant register (ADR+1 address) | ||
MSB | LSB | MSB | LSB |
Examples:
Received bytes of the register N (MSB LSB) | Received bytes of the register N+1 (MSB LSB) | I/O tag type | Value |
---|---|---|---|
0x00 0x00 | 0x00 0x01 | L, S | 1 |
0xFF 0xFF | 0xFF 0xFE | S | -2 |
0x00 0x01 | 0x00 0x02 | L, S | 65538 |
0x3F 0x80 | 0x00 0x00 | f | 1.0 |
0xC0 0x00 | 0x00 0x00 | f | -2.0 |
3. When values are read from two registers as little-endian, the received bytes are analyzed in this way (if Little Endian Mode=2143):
Least significant register (ADR address) | Most significant register (ADR+1 address) | ||
MSB | LSB | MSB | LSB |
Examples:
Received bytes of the register N (MSB LSB) | Received bytes of the register N+1 (MSB LSB) | I/O tag type | Value |
---|---|---|---|
0x00 0x01 | 0x00 0x00 | Ll, Sl | 1 |
0xFF 0xFE | 0xFF 0xFF | Sl | -2 |
0x00 0x02 | 0x00 0x01 | Ll, Sl | 65538 |
0x00 0x00 | 0x3F 0x80 | F | 1.0 |
0x00 0x00 | 0xC0 0x00 | F | -2.0 |
Example of configuration:
The address format is [xN].[I|U|F|B|C|T][b]RdFn[-WrFn].Address[.BitNr] [,Items] in which:
See the example of the configuration in the next section.
Honeywell UDC1700 controllers (probably generally UDC1xxx):
The basic parameters and current data of these controllers are not normally read by means of functions 0x01 up to 0x04. It is necessary to use the functions 0x14/0x15 Read/write configuration reference data. These controllers use "big-endian" byte order. Therefore, for proper functionality, it is not necessary to modify parameters that change byte mode and endianness.
Examples of I/O tag configuration:
20.039 - 16-bit number from address 39(0x27) f20.040 - 32-bit real number from address 40(0x28)
Note: Honeywell-made products (UDC 2xxx/3xxx, HC900, DPR, Trendview) use the common Modbus function codes 1-4 in spite of the UDC manuals referring only to 0x14/0x15 Read/write configuration reference data register tables. For more detailed information, see this post.
The attached ZIP contains the configuration of two lines and two stations with the MODBUS Client/MODBUS Server protocol that communicate via TCP (MODBUS Server listens on a TCP port 9999). Data written through one line is received through the other line. Four I/O tags are configured on each line (Float, with address 3.0, Signed with addresses 4.0 and 4.1, and Bool with address 1.0). MODBUS Server I/O tags values are controlled by the system second (Sec) and use linear conversion (Float is divided by 1000, Signed with address 4.0 is multiplied by 10). The value of the Bool I/O tag is controlled by the eval tag P.TrueFalse, which changes the value True/False every second. |
The attached ZIP contains the configuration of the line, station, and I/O tags for communication with an Emerson chromatograph that implements MODBUS DANIEL®. |
You can read blogs about the Modbus protocol |
-