The Modbus Slave driver implements communication with Master devices compatible with the Modbus Open Standard protocol. It operates as a Slave on TCP/IP or serial networks.

Summary Information

Communication Driver Name: Modbus Slave

Implementation DLL: T.ProtocolDriver.ModbusSlave.dll

Protocol: MODBUS RTU, ASCII, and TCP

Interface: TCP/IP and Serial

Devices supported: Any master Modbus device

Protocol Options: Message Format (ASCII, RTU, or RTU TCP), SlaveID

Multi-threading: One thread with a pooling cycle for each master connected

Max number of nodes: One node for each Channel

PC Hardware requirements: Standard PC Ethernet interface board, RS485, or RS232 port

Supported Operands:


OperandRead WriteData TypeAddress Size
0 – CoilsYesYesBit1 bit
1 – Input StatusYes
Bit1 bit
3 – Input RegistersYes
Word2 bytes
4 – Holding RegistersYesYesWord2 bytes



Channel Configuration

Protocol Options

SlaveID: Defines the driver's slave address in the Modbus Network

Encoding: Determines how information will be packed into the message fields and decoded. The options are:

  • RTU = Remote Terminal Unit mode. In a message, each 8–bit byte contains two 4–bit hexadecimal characters
  • ASCII = The message is encoded in ASCII mode. Each 8–bit byte is sent as two ASCII characters
  • RTU TCP = The default transmission mode when the message is carried on a MODBUS TCP/IP network. It contains information that allows the recipient to recognize message boundaries even if the message has been split into multiple packets

Settings

Serial and MultiSerial channels:

  • Default configuration for ASCII mode:
    • DataBits: 7
    • StopBits: 1 if parity is used. 2 if no parity
  • Default configuration for RTU mode:
    • DataBits: 8
    • StopBits: 1 if parity is used. 2 if no parity
  • Set the other fields according to your Serial or MultiSerial port configuration

TCP/IP channels:

  • Listening Port: Defines the TCP port where the driver listens for the connections. The default TCP port for the Modbus Network is 502


Note

You may need to configure your firewall to open the listening port



Node Configuration

Station Configuration

There is no station configuration for the Modbus Slave driver



Point Configuration

The syntax for the Modbus communication points is: <Operand><Address>

Where:

  • <Operand> indicates the memory area. The valid values are:
    • 0 for Coils
    • 1 for Input Status
    • 3 for Input Registers
    • 4 for Holding Registers

For more information about the valid operands, see Supported Operands.

  • <Address> indicates the data address in the memory area, from 1 to 65535

Ex: 400001 (Operand = Holding Register, Address = 1)



Troubleshoot

The status of the driver's execution can be observed through the diagnostic tools, which are:

• Trace window
• Property Watch
• Module Information

The above tools indicate if the operations have succeeded or have failed. A status of 0 (zero) means communication is successful. Negative values indicate internal driver errors, and positive values indicate protocol error codes.


TermNameDescription 
1ILLEGAL FUNCTIONThe function code received in the query is not allowable
2ILLEGAL DATA ADDRESSThe data address received in the query is not allowable
3ILLEGAL DATA VALUEA value contained in the query data field is not allowable
4SLAVE DEVICE FAILUREError while attempting to perform the requested action
5ACKNOWLEDGERequest accepted, but a long duration of time will be required
6SLAVE DEVICE BUSYThe slave is engaged in a long–duration program command
7NEGATIVE ACKNOWLEDGECannot perform the program function received in the query
8MEMORY PARITY ERRORParity error in the extended memory
  • No labels