Modbus TCP Communications
Modbus is a serial client/server protocol developed by Modicon for industrial automation systems. It is one of the oldest industry standard methods for the transfer of discrete and analog I/O information and register data between industrial protocol and monitoring devices.
There are multiple layers of Modbus TCP (= Modbus protocol with a TCP interface that runs on Ethernet) implementations in In-Sight, and available implementations are varied depending on the firmware versions running on the In-Sight vision systems/sensors. Refer to the table below for the detailed information on each implementation.
Supported Firmware Versions
Modbus TCP Implementations | Firmware Version 4.x.x or Earlier |
Firmware Version 5.1.0 - 5.2.x |
Firmware Version 5.3.0 or Later |
---|---|---|---|
Modbus TCP Server (5.3.0 and later)- spreadsheet and EasyBuilder1 For more information, see Modbus TCP Server Settings Dialog, Modbus TCP Factory Interface (5.3.0 or later), or Configure In-Sight Vision Systems for Modbus TCP Communications. |
Not Supported | Not Supported | Supported |
TCPDevice (client and server) - spreadsheet only |
Supported | Supported | Supported |
Direct Cell Access |
Supported | Not Supported | Not Supported |
ReadModbusBuffer and WriteModbusBuffer functions using input and output buffers (server only) - spreadsheet and EasyBuilder1
|
Supported | Not Supported |
Replaced by ReadUserDataBuffer and WriteResultsBuffer. For more information, see ReadUserDataBuffer or WriteResultsBuffer. |
1 For more information, see Help Menu: EasyBuilder View |
Modbus TCP Commands (5.3.0 or Later)
Code | Description | Address Space |
---|---|---|
0x01 |
Read Coils: This function code is used to read the state of 1 to 2000 contiguous coils in a remote device. This command would be used by a PLC to read data from the vision system/sensor. |
Coil |
0x05 |
Write Single Coil: This function code is used to write a single output coil to either ON or OFF in a remote device. This command would be used by a PLC to write data to the vision system/sensor. |
Coil |
0x0F |
Write Multiple Coils: This function code is used to write a sequence of 1 to 1968 coils to either ON or OFF in a remote device. This command would be used by a PLC to write data to the vision system/sensor. |
Coil |
0x02 |
Read Discrete Inputs: This function is used to read the state of 1 to 2000 contiguous discrete inputs in a remote device. This command would be used by a PLC to read data from the vision system/camera. |
Discrete Input |
0x03 |
Read Holding Registers: This function is used to read the contents of a contiguous block of 1 to 125 holding registers in a remote device. This command would be used by a PLC to read data from the vision system/sensor. |
Holding Register |
0x10 |
Write Multiple Registers: This function code is used to write from 1 to 123 contiguous registers in a remote device. This command would be used by a PLC to write data to the vision system/sensor. |
Holding Register |
0x04 |
Read Input Registers: This function code is used to read from 1 to 125 contiguous input registers in a remote device. This command would be used by a PLC to read data from the vision system/sensor. |
Input Register |
TCP/IP Modbus Commands (4.x.x)
The following Modbus commands are supported:
Read Multiple Registers (Modbus Function Code 03)
Reads the values of multiple cells from the In-Sight spreadsheet, which are returned as 16-bit integers. Error code 02 (ILLEGAL DATA ADDRESS) is returned if any of the cells contain a non-integer value.
Reference Number
|
Defines which cells to read. The high 6 bits (bits 15 through 10) of the Modbus Reference Number define the cell column (A-Z), and the low 10 bits (bits 9 through 0) define the cell row (0-399). For more information, Modbus Reference Number Examples. |
Word Count |
Defines how many cells will be read. For multiple cells, the values returned start at the cell defined by the Reference Number and are incremented by column. If the message requests more values than there are remaining columns in the current row, the server continues reading values from the first cell below the start row. |
Read Multiple Registers Example
Write Multiple Registers (Modbus Function Code 16)
Writes data into an In-Sight spreadsheet cell that contains an EditInt function. Error code 02 (ILLEGAL DATA ADDRESS) is returned if any of the cells do not contain an EditInt function.
Reference Number
|
Defines which cells to write. The first 6 bits (bits 15 through 10) of the Modbus Reference Number define the cell column (A-Z), and the last 10 bits (bits 9 through 0) define the cell row (0-399). For more information, Modbus Reference Number Examples. |
Word Count |
Defines how many cells will be written into the spreadsheet. For multiple cells, the values to be written start at the cell defined by the Reference Number and are incremented by column. If the message writes more values than there are remaining columns in the current row, the server continues writing values into the first cell below the start row. |
Write Multiple Registers Example
Write Coil (Modbus Function Code 05)
Initiates events in the In-Sight spreadsheet. Writing a non-zero value to Coils 0 through 7 will trigger Soft Events 0 through 7 in the spreadsheet. Writing a non-zero value to Coil 8 will trigger an acquire. Error code 02 (ILLEGAL DATA ADDRESS) is returned if the coil number is not in the valid range (0 to 8).
For more information, see Communicate with a Mitsubishi Automation Controller on a CC-Link Network via an Anybus X-gateway, Communicate with a Siemens PLC on a PROFIBUS Network, or Anybus X-gateway.