...
The protocol implements client (master) communication with arbitrary devices which supports support MODBUS RTU or MODBUS ASCII standards (serial communication) as well as MODBUS over TCP/IP. Moreover, it supports two extensions:
- Byte mode - allows working with devices that implement the registers as 1-byte variables (in contrast with Modbus standard in which the register value is 2 bytes).
- Variable mode - allows working with devices that implement the registers with different sizes than standard 2 bytes. It was implemented because of support of the flowmeter FloBoss 103 made by Fisher Controls International (at this time a part of Emerson Process Management): 1-byte variables, 4-byte unsigned/signed integers, text strings of length 10,12,20,40 characters, a 6-byte time stamp, and other.
- Passive (scanning) mode allowing to work in eavesdropping mode. This applies especially to serial communication when the communication port of the device is already used to communicate with another Master device. Due to the nature of the Modbus protocol, it is necessary to receive both requests and responses in this mode.
Kotva |
---|
| komunikacna_linka |
---|
| komunikacna_linka |
---|
|
Communication line configuration
...
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 |
| tnd | 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 Tcp No Delay parameter to YES | tnd | Tcp No DelaySetting Tcp No Delay parameter to YES causes low-level socket option TCP_NODELAY being 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 |
...
Parameter | Meaning | Unit | Default value |
---|
| Maximum count of request retries. If no response returns after a request had 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 |
| 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 - first the lower word is received, then the higher word (higher byte within the word is always first)
- 3412 - first the higher word is received, then the lower word (lower byte within the word is always first)
- 1234 - bytes are received from lowest to highest (direct opposite of big-endian)
| - | 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: Little endian = the lowest bytes are sent first Big endian = the highest bytes are sent first OFF = variable mode is switched off Note 1: Variable and byte mode modes are incompatible and only one of them can be enabled. Note 2: Emerson FloBoss 103 device: text strings and time stamps of 6-byte are sent always from the lowest byte. Note 3: Variable mode is implemented only for Protocol Mode=RTU. Note 4: A data encoding big-endian is used automatically, according to the default parameter values Byte mod=NO and Variable mode=OFF (i.e. according to MODBUS protocol specification). | 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 MODBUS PDU. After you change this parameter, a restart a proper communication processof 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 |
| sku | sku | 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). Bitmask 01 means that only the lowest bit is considered. If the address of the I/O tag specifies the use of only the lower/upper byte of the register, the lowest/second lowest byte of the mask is applied. | - | FF FF FF FF |
| This parameter is used to avoid reading the values from addresses that are not configured. Description and example: The requests for data, which are limited by protocol parameter "Max. Registers" or "Max. Bytes", are sent as standard. If I/O tags with addresses "Holding Registers" 1, 2, and 5 have been configured, one request reading 5 registers starting with address 1 is sent although the I/O tags with addresses 3 and 4 are not configured. It is Skip UnconfiguredTo read the values from addresses that are not configured is not allowed.Description and example: The requests for data, which are limited by protocol parameter "Max. Registers" or "Max. Bytes", are sent as standard. If I/O tags with addresses "Holding Registers" 1, 2, and 5 have been configured, one request reading 5 registers starting with address 1 is sent although the I/O tags with addresses 3 and 4 are not configured. It is more efficient to obtain the required data by one request than by two ones even if the unnecessary data are also read. If the parameter "Skip Unconfigured" is set on YES, two requests are sent, the first one reads two registers from address 1 and the second one reads one register from address 5registers from address 1 and the second one reads one register from address 5. Some Modbus servers respond by exception to reading of a range of registers that contains "unknown" registers (which e.g. they don't have mapped to internal memory). | 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:- if Byte mode is on (Byte mode=YES), the length of received data must be equal to the number of registers
- if both Byte mode and variable mode are off, the length of received data must be equal to the double of the number of registers
- if the variable mode is on (Variable mode=little-endian or big-endian), check has not been implemented yet
This extra check is reasonable on high-latency and variable-latency lines - e.g. GPRS networks - to detect and avoid the situation when read request (#1) is repeated due to timeouts and then two responses are received, the second of which could be considered to be an answer to another read request (#2), thus causing wrong values being assigned to I/O tags addressed by this read request #2could be considered to be an answer to another read request (#2), thus causing wrong values being assigned to I/O tags addressed by this read request #2. | 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. This mode can be used for special devices that send all data (with variable size registers - 2, 4, 8 bytes - in a single response). | YES/NO | NO |
I/O tag configuration
...
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).
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] in which:
Note about the byte and register order
...
Extended format of I/O tag address:
Address format is [xN].[I|U|F|B|C|T][b]RdFn[-WrFn].Address[.BitNr] in which:
- xN indicates the number of bytes that read or write. Valid values for N are 1, 2, 4, 8 (in combination with I, U, F), 6 for T type, and an arbitrary number for C type.
- A letter defines the type of I/O tag. Besides standard I, U, F, B, two extra types have been added:
- C - text string of fixed length (e.g. x10.C3.1001 is a 10-character string on address 1001)
- T - time stamp with length of 6 bytes (ss:mi:hh dd:mm:yy)
- The meaning of other parameters is in compliance with the standard mode.
...
Info |
---|
|
You can read blogs about the Modbus protocol |
Changes and modifications
...
- Ver. 1.0 - November 27th, 2006 - document creating.
- Ver. 1.1 - November 21st, 2007 - document update.
- Ver. 1.2 - April 24th, 2009 - document update.
- Ver. 1.3 - November 3rd, 2010 - document update.
- Ver. 1.4 - December 6th, 2010 - document update.
- Ver. 1.5 - September 5th, 2022 - document update (support for 8-byte values in the extended format).
- Ver. 1.6 - September 7th, 2022 - document update (added parameter "Dummy Request Mode").
...