Modbus (RTU)
The following applies to Modicon PLC’s running the Modbus RTU protocol.
Details on the device address can be found in the Device Properties Information Topic
External Address Format
External Address is an ascii string which exactly references an item of data within the PLC. It can be entered at configure time as a text string, and will be validated by the system before use. For this protocol the external address has the following format:
N - Dec number 0 - 9
Type |
Offset |
CL |
NNNNN |
IN |
NNNNN |
HR |
NNNNN |
IR |
NNNNN |
Offset Format
The software also allows an item of data within the PLC to be referenced by means of a table selection and an offset. The following table shows the offset and table formats for the Modicon PLC:
Table |
External Address Type |
Type |
Offset Format |
Offset Range |
Privilege R = Read W = Write |
Description |
Coils |
CL |
Bit |
NNNNN |
00001-65535 |
RW |
Internal digital data |
Inputs |
IN |
Bit |
NNNNN |
00001-65535 |
R |
Digital inputs |
Holding registers |
HR |
Word |
NNNNN |
00001-65535 |
RW |
Internal analog data |
Input registers |
IR |
Word |
NNNNN |
00001-65535 |
R |
Analog inputs |
Property Pages
No property pages exist for this protocol
Protocol Compatibility
A bit type table such as ‘CL’ will support the configuration of point types bigger than a bit. If a 16-bit point is configured for example, 16 bits will be read from the table to fill the point. The modbus protocol does not support writing of back multiple bit points. These will cause a comms block error.
A word type table such as ‘HR’ supports the configuration of smaller or bigger point types. All larger point types will read the required number of words to fill the point. Byte type points will scale down the word to fit it into a byte. Bit type points allow the selection of a bit offset to reference the required bit from the word (0-15). In the case of bit selection points, drive outs will perform a read/modify/write operation as the protocol does not support a bit set operation in this case.
Port Settings
Port settings will depend on the PLC type. The following shows a typical port setup:
RS232
|
Baud Rate |
9600 |
|
Data Bits |
8 |
|
Stop Bits |
1.0 |
|
Parity |
Even |
Wiring Information
Exact wiring information will depend on the type of PLC we are connecting to. Consult the documentation provided by the PLC manufacturer for wiring details.
Example
An example of the External Address for the 15th Coil would be:
CL00015