Issue
The I/A Series G3 Modbus TCP slave device is unable to establish communications with a Modbus client requesting a unit identifier of 255. The ENC/JACE rejects the message because the Modbus TCP slave device address can only be configured with a value between 1 to 247.
Environment
I/A Series G3 (all versions)
Cause
The Modbus TCP slave device address can only be configured with a value between 1 to 247 and Workbench will generate an exception if a value outside this range is entered and saved.
Per the Modbus TCP standard, the Modbus TCP/IP Application Data Unit (ADU) takes the form of a 7 byte header (transaction identifier, protocol identifier, length field, and unit identifier) plus the protocol data unit (function code + data).
The 7 byte MBAP header includes the following fields:
- Transaction/invocation Identifier (2 Bytes): This identification field is used for transaction pairing when multiple messages are sent along the same TCP connection by a client without waiting for a prior response.
- Protocol Identifier (2 bytes): This field is always 0 for Modbus services and other values are reserved for future extensions.
- Length (2 bytes): This field is a byte count of the remaining fields and includes the unit identifier byte, function code byte, and the data fields.
- Unit Identifier (1 byte): This field is used to identify a remote server located on a non TCP/IP network (for serial bridging). In a typical Modbus TCP/IP server application, the unit ID is set to 0 or 0xFF (255), ignored by the server, and simply echoed back in the response.
Resolution
The I/A Series G3 Modbus TCP slave device address can only be configured with a value between 1 to 247 and Workbench will generate an exception if a value outside this range is entered and saved. The workaround is to configure the value as follows.
- Right click on the ModbusTcpSlaveNetwork and view the ModbusTcpSlaveDevice objects.
- Right click on the ModbusTcpSlaveDevice object and select Pin Slots.
- Select the Device Address slot to pin ... select OK,
- Create a NumericWritable and set the value to 255.
- Link the output of the NumericWritable to the Device Address.