User's Manual
COBALT UHF-SERIES CHAPTER 7: MODBUS TCP INTERFACE
PAGE 119 OF 140
7.3.1 Modbus TCP - Host/Cobalt Handshaking
When the host issues a command, it must first write the entire command to the Node
Input Page, leaving the Overall Length value to be written last.
For example, for the host to issue the 6-word command “Read Data,” it must first
write the last five words of the command to Node Input Page 01, beginning at register
40002. After which, the host will fill in the first word (at holding register 40001) with
the Overall Length of the command packet.
Last Five Words of a Read Data Command
WORD MSB LSB DESCRIPTION
02
0xAA 0x05 Command ID: Read Data
03
0x00 0x01 Node ID: 0x01
04
0x03 0xE8 Timeout Value: 1 second
05
0x00 0x20 Read Start Address: 0x0020
06
0x00 0x04 Block Size: 4 Bytes
After writing the last five words of the command, the host will write the Overall Length
value to holding register 40001 of Node Input Page 01.
First Word of a Read Data Command
WORD MSB LSB DESCRIPTION
01
0x00 0x06 Overall Length (in words)
The moment the Overall Length value (at holding register 40001) of Node Input Page
01 changes from 0x0000 to a “non-zero” value, the Cobalt will recognize the waiting
data and will execute the command.
7.3.2 Modbus TCP - Handshaking Example
1.
The host or PLC issues an RFID command to the Cobalt, writing the command
string to the holding registers for Device ID 01 (Node Input Page 01). An Overall
Length value of 0x0006 is written last to holding register 40001.
2.
The Cobalt recognizes that the Overall Length value at holding register 40001
has changed for Device ID 01 (Node Input Page 01), indicating that a command
is waiting to be executed.
3.
The Cobalt executes the command and then clears the Overall Length holding
register of Device ID 01 (Node Input Page 01), setting it back the default value of
zero (0x0000).
NOTE: when the Node Input Page’s value at register 40001 is returned to 0x0000, the
host can assume that the command was at least received and execution was
attempted. The host can also assume that it is OK to clear the remaining holding
registers and write another command to the Device ID (Node Input Page).