Skip to content

Adapter - Modbus TCP

This page describes version 2.0.7 of the adapter.

Overview

This adapter is used to control communication between Modbus compatible devices and the Workflow Engine. The communication is done via TCP/IP.

Note

Most Modbus devices require 32-bit values be transferred using big-endian order.  For example, the 32-bit floating point number 10.0 is typically represented in memory as two 16 bit words 0x4120-0x0000.   Before the data can be sent to the Modbus device it must be arranged in big-endian order, if not already, as follows; 0x0000-0x2041 =>.  However, some Modbus devices require that the data be sent as two individual big endian 16-bit words with the least significant word being sent first.  In this case, the data would need to be arranged and sent as 0x0000-0x4120 =>.  Therefore, it is important to consult the Modbus device's documentation before writing values to registers.



Properties

Name Display Is Required Comments Type Default Value Maximum Value Minimum Value Maximum Length Minimum Length
serviceAddress ModbusTcp controller service address False The host address to connect to the ModbusTcp controller service. string 1024 1
servicePort ModbusTcp controller service port False The port to connect to the ModbusTcp controller service. integer 502 65535 1



Commands

Read Coils (readCoils)

Reads one or more coils of a device. (Modbus function 1).

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
startAddress Coil Start Address The coil start address. (0-65535) True string
coilCount Coil Count The number of coils to read. (1-2000) False string

Response Properties

Name Description Type
coil The array of coils and their settings. array

Write Single Coil (writeSingleCoil)

Writes a single coil status to the Modbus device. (Modbus function 5)

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
coilAddress Coil Address The coil address to write. (0-65535) True string
coilSetting Coil Setting The coil setting to write. (True,False) True string

Write Single Register (writeSingleRegister)

Writes a single coil status to the Modbus device. (Modbus function 6)

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
registerAddress Register Address The coil address to write. (0-65535) True string
registerData Register Data The register data to write. (0-65535) True string

Write Multiple Registers (writeMultipleRegisters)

Writes a data to multiple registers on Modbus device. (Modbus function 16)

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
startAddress Start Address The first address to write. (0-65535) True string
registerValues Register Values Comma delimited 16 bit data values to write. True string

Write Float(s) To Registers (writeFloatsToRegisters)

Writes one or more 32 bit floating point values using 2 - 16 bit registers per value. (Modbus function 16)

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
startAddress Start Address The first address to write. (0-65535) True string
floatValue Float Value The 32 bit floating point value to write to the MODBUS device. Will be sent as 2 - 16 bit words True string
isBigEndianWordOrder Big-Endian Word Order? Set to 'true' to send the high word first, and then the low word. Otherwise, the low word is sent first and then the high word. False string

Read Float(s) From Registers (readFloatsFromRegisters)

Reads one or more floating point values.

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
startAddress Start Address The first holding register address to read. (0-65535) True string
count Count The number of floating point values to read. False string
isBigEndianWordOrder Big-Endian Word Order? Set to true if the device stores the high word first and the low word second. False string

Response Properties

Name Description Type
float The array of floating point values. array

Read Holding Registers (readHoldingRegisters)

Reads one or more holding registers of a device. (Modbus function 3).

Request Properties

Name Display Description Is Required Type
serviceAddress Service Address The host address to connect to the ModbusTcp controller service. False string
servicePort Service Port The port to connect to the ModbusTcp controller service. False string
deviceId Device ID The id to address the device (slave). (0-255) False string
startAddress Start Address The first holding register address to read. (0-65535) True string
registerCount Register Count The number of registers to read. (1-125) False string

Response Properties

Name Description Type
holdingRegisters The array of holding register values. array

Release History

Version Type Description Tracking # Date
2.0.1 Initial First release in the Adapter Type store.
2.0.5 Maintenance Updated third-party components and improved maintainability. NAP-11518
2.0.6 Maintenance Updated third-party components and improved maintainability. NAP-23945 2022-11-29
2.0.7 Maintenance Updated third-party components and improved maintainability. NAP-27635 2024-07-31

Categories