All Collections
Connect your Devices
Use vNode to poll sensor data using Modbus TCP
Use vNode to poll sensor data using Modbus TCP

The following technical guide illustrates the process of using vNode as a Modbus TCP client querying data from an ADAM-6700 as the server

S
Written by Sergio M
Updated over a week ago

Requirements

  • An Active Ubidots account

  • vNode installed

  • A DAQ module supporting Modbus TCP. In this guide, a ADAM-6700 was used.

1. Enabling and launching vNode

You must already have installed vNode in order to go further the next steps. If you haven't, please head to the following link and follow the instructions to install it.

Launch vNode by typing the following in your web browser:

http://localhost:8003/

2. Creating the Modbus TCP module

  • Go go the Config menu on the left side panel

  • Expand the Modules option

  • Click on the Hamburger icon as shown below

  • Click New Module

  • Give a name to the module being created

  • Upon naming your Module (here it was named as myModbusClient), the configuration settings will be displayed. Go to the Module Type option and select ModbusClient from the drop down menu, then hit the Save button:

  • Expand the Modules option and click on the Module that you just created. If you have been following this guide's nomenclature, then it should be "myModbusClient".

  • Click the Hamburger icon under the Model section and click New Channel. Upon clicking on it, give a name for this channel (in this guide it was set to "CH1")

  • After the channel is created, its configuration settings will be displayed, there, make sure of the following:

    • Enable data collection: is set to true

    • Connection type: is set to TCP

    • Modbus mode: is set to TCP

    • Host: is set to the IP address of the modbus server that you want to read the data from. For this guide, the reading is done on a device with IP address 192.168.22.191

    • TCP port: is set to the TCP port in which the modbus server is running. For this guide, the reading is done on a device running the Modbus server on port 502

  • All of the other settings you can configure according to your requirements.

  • Right click on the channel created above and select the New device option. Give a name to said device. In this guide the device's name was set to ADAM6700. Upon creating this device, its options will be displayed. Make sure that the Enable data collection option is set to true.

3. Creating the Tag to read the data

  • Go to the Tags option on the left side panel

  • Under the Model panel, click the Hamburger icon and select the New group option. Give a name to this Tag group. In this guide, it was set to modbusTCPGroup.

  • Right click on the recently created Tag group and select the New tag option.

  • Give a name to this Tag. Since this tag will store the temperature reading obtained from the ADAM, its name was set to temperature:

  • Click on the Tag that you just created to visualize its configuration settings, go to the Source section and edit the settings as follows:

    • Make sure the Enableb option is set to yes or true

    • Set the Module Type to ModbusClient

    • Set the Module name to that with which you created the module. If you have been following this guide's nomenclature, it should be myModbusClient.

    • set the Device option to the name of the channel + the device name. For example CH1/ADAM6700.

  • You can leave all the other settings as per their default options or configure it according to your needs.

  • Click the save button.

4. Visualize the measured data

  • Head to the Real Time option on the panel at the left side.

  • Click on the Tag Group that you created

  • Here, you'll be able to visualize the data polled through Modbus TCP:

5. Send data to Ubidots through MQTT

  • Please refer to the following documentation so you can set up the required configurations in order to send the data to Ubidots.

6. Feedback, Suggestions and Related Articles

Feel free to post questions or suggestions in our community portal, or contact us via support@ubidots.com.

Other users also found helpful...

Did this answer your question?