Connect Modbus TCP / RTU devices through an Atom NX Industrial
In this article we are going to cover the following topics:
Connect Modbus RTU devices
- Connect the device that you want to use into the Atom NX Industrial serial port Refer to the figure below to connect the Modbus device.
- Enter
nilvana flow
website nilvana flow
http://[your_atom_ip]:1880/
- Pull out the
modbus editor
node to operate your Modbus device Double-click on the
- Server
- Choose or edit the Modbus serial server configuration to specify the server to connect to. Click the server settings button
to set the
baud rate
and other settings of your device. please select the default/dev/ttyTHS0
that is the built-in serial port of Atom NX Industrial Modbus.
- Choose or edit the Modbus serial server configuration to specify the server to connect to. Click the server settings button
- Unit-Id
- Enter the ID of your device (range 0~247)
- Function Code
- Choose a function code (FC)1, 2, 3, 4, 5, 6, 15 ,16 from the dropdown menu
- FC 1: Read Coil Status - FC 2: Read Input Status - FC 3: Read Holding Registers - FC 4: Read Input Registers - FC 5: Force Single Coil - FC 6: Preset Single Register - FC 15: Force Multiple Coils - FC 16: Preset Multiple Registers
- For FC 5, msg.payload must be a value of 1 or 0 or true or false.
- For FC 6, msg.payload must be a single value between 0~65535.
- For FC 15, msg.payload must be an array[] of comma separated values true or false each.
- For FC 16, msg.payload must be an array[] of comma separated values between 0~65535 each.
- Address
- start address to read/write. (range 0~65535)
- Quantity
- the count of items start from to be read/write
- Modbus RTU flow example
- import example flow
- Click the
import
button from themenu
button in the upper right corner - Choose to import the json file or paste the content of the json file and click the
import
button - You will see the flow like the picture below
- Click the
- import example flow
modbus editor
node.
Connect Modbus TCP devices
- Enter
nilvana flow
website nilvana flow
http://[your_atom_ip]:1880/
- Pull out the
modbus editor
node to operate your Modbus TCP server Double-click on the
- Server
- Choose or edit the Modbus TCP server configuration to specify the server to connect to. Click the server settings button
to set the
IP
andPort
.
- Choose or edit the Modbus TCP server configuration to specify the server to connect to. Click the server settings button
- Unit-Id
- Enter the ID of your device (range 0~247)
- Function Code
- Choose a function code (FC)1, 2, 3, 4, 5, 6, 15 ,16 from the dropdown menu
- FC 1: Read Coil Status - FC 2: Read Input Status - FC 3: Read Holding Registers - FC 4: Read Input Registers - FC 5: Force Single Coil - FC 6: Preset Single Register - FC 15: Force Multiple Coils - FC 16: Preset Multiple Registers
- For FC 5, msg.payload must be a value of 1 or 0 or true or false.
- For FC 6, msg.payload must be a single value between 0~65535.
- For FC 15, msg.payload must be an array[] of comma separated values true or false each.
- For FC 16, msg.payload must be an array[] of comma separated values between 0~65535 each.
- Address
- start address to read/write. (range 0~65535)
- Quantity
- start address to read/write. (range 0~65535)
- Modbus TCP flow example
- import example flow
- Click the
import
button from themenu
button in the upper right corner - Choose to import the json file or paste the content of the json file and click the
import
button. - You will see the flow like the picture below
- Click the
- import example flow
modbus editor
node