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

  1. Connect the device that you want to use into the Atom NX Industrial serial port
  2. Refer to the figure below to connect the Modbus device.

  3. Enter nilvana flow website
  4. nilvana flow http://[your_atom_ip]:1880/

  5. Pull out the modbus editor node to operate your Modbus device
  6. Double-click on the modbus editor node.

    • 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.
    • 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
  7. Modbus RTU flow example
    • import example flow
      • Click the import button from the menu 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

Connect Modbus TCP devices

  1. Enter nilvana flow website
  2. nilvana flow http://[your_atom_ip]:1880/
  3. Pull out the modbus editor node to operate your Modbus TCP server
  4. Double-click on the modbus editor node

    • 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 and Port.
    • 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)
  5. Modbus TCP flow example
    • import example flow
      • Click the import button from the menu 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

Still need help? Contact Us Contact Us