This document has only the specific information about the device connection settings and its address syntax.

Refer to the User Guide for more information on the Device Module.



Summary

Modbus driver implements communication with PLC and IO devices compatible with Modbus Open Standard protocol. It operates as a Master on TCP/IP or serial networks. The communication blocks are dynamically created according to the pooling cycle defined on the AccessType for each Device Point.

Communication Driver Information
Driver nameModbus
Assembly NameT.ProtocolDriver.Modbus
Assembly Version1.11.0.7
Available for LinuxTrue
Devices supported 

Any PLC compatible with Modbus

ManufacturerN/A (Not Applicable)
ProtocolMODBUS RTU, ASCII and TCP
InterfaceTCP/IP and Serial
Protocol OptionsMessage Format (ASCII, RTU or RTU TCP), use block write command (0x0F or 0x10) or single write command (0x05 or 0x06) for single writings
Multi-threadingUser configurable. Default is 5 threads to each network node
Max number of nodesUser defined
PC RequirementsEthernet port

Supported Operands

Operand

Read

Write

Data Type

Address size

0 – Coils

Yes

Yes

Bit

1 bit

1 – Input Status

Yes

-

Bit

1 bit

3 – Input Registers

Yes

-

Word

2 bytes

4 – Holding Registers

Yes

Yes

Word

2 bytes

%Q – Coils

Yes

Yes

Bit

1 bit

%M– Coils

Yes

Yes

Bit

1 bit

%I – Input Status

Yes

-

Bit

1 bit

%IW– Input Registers

Yes

-

Word

2 bytes

%MW – Holding Registers

Yes

Yes

Word

2 bytes

%QW – Holding Registers

Yes

Yes

Word

2 bytes


Channels Configuration

Protocol Options

  • BlockSize: Defines the maximum amount of items per group, the default value is 250.

If the communication points are configured in sequence and the BlockSize equals to 250, the driver can create the internal groups with 125 Registers or 2000 Coils.

  • EncodingDetermines how the information will be packed into the message fields and decoded. The options are:
    • RTU: Remote Terminal Unit mode, where each 8–bit byte in a message contains two 4–bit hexadecimal characters
    • ASCII: The message is encoded in ASCII mode, where each 8–bit byte in a message 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 to allow the recipient to recognize message boundaries even if the message has been split into multiple packets

 

  • SingleWrite: Indicates the driver behavior for the writings with only one item:
    •  Use block write : The driver uses the 0x0F command for Coils, or the 0x10 command for Holding Registers
    • Use single write: The driver uses the 0x05 command for Coils, or the 0x06 command for Holding Registers

 

  • Offset address:  Indicates the driver is zero based address.

Settings

Serial and MultiSerial channels:

  • Default configuration for ASCII mode :
    • DataBits: 7
    • StopBits: 1 if parity is used; 2 if no parity is used


  • Default configuration for RTU mode :
    • DataBits: 8
    • StopBits: 1 if parity is used; 2 if no parity is used


Set the other fields according to your Serial or MultiSerial port configuration.

TCP/IP channels:

  • NodeConnections: Defines the maximum number of parallel requests that will be sent to each node (asynchronous communication)



Nodes Configuration

Station Configuration

  • SlaveId:  Set this field with the address of the slave device in the Modbus Network. They can be addressed from 1 to 247 for serial nodes, or 0 to 255 for TCP/IP nodes. The address 0 is used for the broadcast.

 

Serial channels:

  • Station syntax: <SlaveId>

E.g.: 1

 

MultiSerial channels:

  • Station syntax: <Com Port> ; <SlaveId>

Where: 

<Com Port>: the serial port number

  • Ex: com1 ; 1

 

TCP/IP channels:

  • Station syntax: <IP address> ; <Port number> ; <SlaveId>

Where :

  • <IP address>: IP address of the slave device in the modbus network
  • <Port number>: TCP port where the slave device is listening (default is 502)

E.g.: 192.168.1.101 ; 502 ; 1



Points Configuration

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

Where:

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

Valid values for <Operand>

0 – Coils

1 – Input Status

3 – Input Registers

4 – Holding Registers

%Q – Coils

%M– Coils

%I – Input Status

%IW– Input Registers

%MW – Holding Registers

%QW – Holding Registers

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

E.g.: 400001 (Operand = Holding Register, Address = 1)

 Configure ASCII Communication:

  • To use the ASCII communication with Modbus, it is necessary to modify the column Modifiers. In StringLength you need to put an even value number.
  • Create a new AccessType to use only with ASCII type points.



Troubleshoot


Modbus protocol error codes

Error

Name

Description

1

ILLEGAL FUNCTION

The function code received in the query is not allowable.

2

ILLEGAL DATA ADDRESS

The data address received in the query is not allowable.

3

ILLEGAL DATA VALUE

A value contained in the query data field is not allowable.

4

SLAVE DEVICE FAILURE

Error while attempting to perform the requested action.

5

ACKNOWLEDGE

Request accepted, but a long duration of time will be required.

6

SLAVE DEVICE BUSY

The slave is engaged in a long–duration program command.

7

NEGATIVE ACKNOWLEDGE

Cannot perform the program function received in the query.

8

MEMORY PARITY ERROR

Parity error in the extended memory.


Driver Revision History

Modbus Revision History
Version Notes
1.11.0.1Initial release on new documentation standards.

In this section...

  • No labels