MODBUS Client communication protocol

Supported device types and versions
Communication line configuration
Line protocol parameters
Station configuration
I/O tag configuration
Note to FloBoss 103 device
Note to Honeywell
Literature
Changes and modifications
Document revisions

Supported device types and versions


The protocol executes client (master) communication with arbitrary devices which supports a standard MODBUS RTU and ASCII in the versions of serial communication as well as MODBUS over TCP/IP. Moreover, it supports two extensions:

Communication line configuration


Line protocol parameters


A dialog window of communication line configuration - Protocol parameters tab.
They influence some optional protocol parameters.

The line protocol contains the following parameters:

ParameterMeaningUnitDefault value

Immediate Disconnect

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/NONO

Tcp No Delay

Setting Tcp No Delay parameter to YES causes low-level socket option TCP_NODELAY being 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/NONO

Station configuration



Station protocol parameters

Configuration dialog box - tab Parameter.
They influence some optional parameters of the protocol. The following station protocol parameters can be set:

Table 1

ParameterMeaningUnitDefault value
Retry Count
Maximum count of request retries. If no reply returns after a request had been sent, the station will be in the status of a communication error.s2
Retry Timeout
Timeout before resending a request if no reply had not received.s0.1
Wait First Timeout
Delay after sending the request before reading the response.s0.1
Wait Timeout
Timeout between reading the reply.s0.1
Max. Wait Retry
The maximum number of retries of the reply reading.-20
Start Silent Interval
"Start silent interval" before the beginning of the transmission in RTU mode.ms50
Stop Silent Interval
"Stop silent interval" after ending of the transmission in RTU mode.ms50

Little Endian Mode

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

Byte mode

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/NONO
Variable mode
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 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
Full debug
Logging of detailed debug information about communication in the line log.YES/NONO
Protocol mode
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
Addressing model
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, restart a proper communication process.
MODBUS PDU
MODBUS data Model
MODBUS PDU
TCP/IP protocol variant
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"
Max. Registers
Maximum count of registers that are read by one request.-100
Max. Bytes
Maximum count of bytes that are required by one request (only in "Byte mode").-100
Skip Unconfigured
To 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 the 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 5.

YES/NONO
Check Receive Length
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 equal to the number of registers
  • if both Byte mode and variable mode are off, the length of received data must equal to 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 #2.
YES/NONO

I/O tag configuration


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.


I/O tag address:

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.

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

1. MODBUS protocol uses the big-endian, i.e. the most significant byte (MSB) is transmitted as first. Examples:

Received bytes of MSB-LSBI/O tag typeValue
0x00 0x01I, U1
0xFF 0xFEI-2
0xFF 0xFEU65534
0x01 0x02B1
0x01 0x02X2

2. When values are read from two registers as big-endian the received bytes are analysed in this way:

Most significant register (ADR address)Least significant register (ADR+1 address)
MSBLSBMSBLSB

Examples:

Received bytes of register (MSB-LSB)Received bytes of register + 1 (MSB-LSB)I/O tag typeValue
0x00 0x000x00 0x01L, S1
0xFF 0xFF0xFF 0xFES-2
0x00 0x010x00 0x02L, S65538
0x3F 0x800x00 0x00f1.0
0xC0 0x000x00 0x00f-2.0

3. When values are read from two registers as little-endian the received bytes are analysed in this way (if Little Endian Mode=2143):

Least significant register (ADR address)Most significant register (ADR+1 address)
MSBLSBMSBLSB

Examples:

Received bytes of register (MSB-LSB)Received bytes of register + 1 (MSB-LSB)I/O tag typeValue
0x00 0x010x00 0x00Ll, Sl1
0xFF 0xFE0xFF 0xFFSl-2
0x00 0x020x00 0x01Ll, Sl65538
0x00 0x000x3F 0x80F1.0
0x00 0x000xC0 0x00F-2.0


Example of configuration:


Extended format of I/O tag address:

Address format is [xN][I|U|F|B|C|T][b]RdFn[-WrFn].Address[.BitNr] in which:

See the example of the configuration in the next section.

Note to FloBoss 103 device



Note on Honeywell controllers


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 function 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)

Literature



You can read sblog about  Modbus protocol:


Changes and modifications


-

Document revisions


Communication protocols