...
- 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.
Note: this mode enables work with devices implementing the so-called Enron Modbus or Daniel Modbus. - Passive (scanning) mode allows 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.
...
- 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 double the number of registers
- if the variable mode is on (Variable mode=little-endian or big-endian), the check has not been implemented yet
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: | YES/NO | NO | 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:
| |||||||||||
Kotva | ||||||||||||
crl | crl | 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 |
...
- The first character defines a type of I/O tag:
- I - Integer16 (default) - one register is read, signed
- U - Unsigned16 - one register is read, unsigned
- Uu - Unsigned16 - one register is read, unsigned, and only the upper byte is processed (1st in sequence)
- Ul - Unsigned16 - one register is read, unsigned, and only the lower byte is processed (2nd in sequence)
- f - Float (4 bytes = 2 registers) - two registers with Address and Address+1 are read and transmitted as big-endian (see Note).
- F - Float (4 bytes = 2 registers) - two registers with Address and Address+1 are read and transmitted as little-endian (so-called Modicon format), (see Note)
- L - Unsigned long (4 bytes = 2 registers) - two registers with Address and Address+1 are read, unsigned, and transmitted as big-endian (see Note)
- Ll - Unsigned long (4 bytes = 2 registers) - two registers with Address and Address+1 are read and transmitted as little-endian, unsigned (see Note)
- S - Signed long (4 bytes = 2 registers) - two registers with Address and Address+1 are read, signed, and transmitted as big-endian (see Note)
- Sl - Signed long (4 bytes = 2 registers) - two registers with Address and Address+1 are read and transmitted as little-endian, signed (see Note)
- B - Byte unsigned, only the upper 8 bits of the register value
- X - Byte unsigned, only the lower 8 bits of the register value
- sn. - Text string with the length of n characters, one register is one character, n registers with Address up to Address+n-1 are read
- an. - Text string with the length of 2*n characters, one register is two ASCII characters, characters are transmitted in the same order as they appear in the string, n registers with Address up to Address+n-1 are read
- An. - Text string with the length of 2*n characters, one register is two ASCII characters, characters are transmitted in big-endian order (i.e. "1234" is transmitted as "2143"), n registers with Address up to Address+n-1 are read
- Modifier d indicates that a number is an 8-byte number (4 consecutive registers). It can be used for types L, Ll, S, Sl, F,f, and it is used for configuration of signed/unsigned 8-byte integer as well as an 8-byte float (big-endian <B8>..<B1> and little-endian <B1>..<B8> formats).
Modifier D indicates that a number is an 8-byte number (4 consecutive registers). It can be used for types Ll, Sl, F and it is used for the configuration of signed/unsigned 8-byte integer as well as an 8-byte float (little-endian format <B2><B1><B4><B3><B6><B5><B8><B7>). - Modifier b indicates that the number BCD-coded. It can be used for I/O tags of I, U, B, L, Ll types.
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 ModBusWeak - Parameter RdFn is a function of the Modbus protocol for data reading. The following functions are implemented:
- 1 - Read Coils: binary status reading
- 2 - Read Discrete Inputs: binary input reading
- 3 - Read Holding Registers: status register reading (Integer16/Unsigned16 and Float32 - reads two successive registers)
- 4 - Read Input Registers: input register reading (Integer16/Unsigned16 and Float32 - reads two successive registers)registers)
- 20 - Read Configuration Reference Data: reading of configuration data
- 0 - A value is not read, it is only written. The function for writing (WrFn) must be set.
- Parameter WrFn is the function of the Modbus protocol for data writing. The following functions are implemented:
- 5 - Write Single Coil: binary status writing (default for Read Coils)
- 6 - Write Single Register: status register writing (default for Read Holding Registers)
- 16 - Write Multiple registers: multiple registers writing, it must be used when a 2-register type is written (e.g. Float, Unsigned long, etc.).
Note: The function can be used to write more than two registers at once if a text string is used. Example:
if we have an I/O tag with address a3.0-16.#8A00 (i.e. text string covering 3 registers, having a length of 6 characters) and we write a string '123456', then hexadecimal values 0x3132, 0x3334 and 0x3536 (ASCII code for '1' is 0x31, for '2' is 0x32, etc) will be written to registers 0x8A00, 0x8A01 and 0x8A02. - 21 - Write Configuration Reference Data: writing of configuration data
- 22 - Mask Write Register: write affects only the value of the particular bit BitNr of the status register. It is usable only for Do value types with the address parameter BitNr.
- Parameter d activates the function "delayed write". The sending of the value is delayed until the request to write the value of the object without parameter d comes. All accumulated requests waiting to be written are sent. If the function WrFn is set to "Write Multiple Registers", the values are sent in one packet.
- Parameter Address is a 2-byte address of the register (0-65536). See also the protocol parameter Addressing model.
Note: address can be specified as a hexadecimal number using a number sign (#), e.g. #50CE - Parameter BitNr is a bit's position in a word. The values 0-7 are allowed to be used for binary statuses and inputs, and values 0-15 are allowed to be used for reading bits from 16-bit status or input registers.
Note: coexistence of an I/O tag without a BitNr parameter and multiple I/O tags with a BitNr parameter having the same Address is possible. - Parameter Items indicates the number of objects to read. This parameter is only meaningful if the Destination Column is configured. The parameter specifies the number of objects that will be read and written to the structured variable. If this parameter is not specified, the number of read objects is derived from the size of the structure, so this parameter allows to limit the number of read items (e.g. if values are to be read into the next rows of the structure using another I/O tag).
...
Info | ||||||
---|---|---|---|---|---|---|
| ||||||
The attached ZIP contains the configuration of two lines and two stations with the Modbus MODBUS Client/Modbus MODBUS Server protocol that communicate via TCP (Modbus 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 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 value of the Bool I/O tag is controlled by the eval tag P.TrueFalse, which changes the value True/False every second.
|
Info | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The attached ZIP contains the configuration of the line, station, and I/O tags for communication with an Emerson chromatograph that implements MODBUS DANIEL®.
|
Info | ||
---|---|---|
| ||
You can read blogs about the Modbus protocol |
...