06-03-2019 05:20 PM
I am trying to develop a LabVIEW code to read data from a device that uses Modbus RTU over TCP/IP: The setup looks something like this: A Gateway provide IP network (physical layer Ethernet) to XBee networks using Modbus RTU.
E.G. 8 Zbee device (address 1 to 😎 connected to the gateway device. a pc running labview will need to interface with the gateway over TCP (ethernet). How do I write a simple code to facility this?
06-03-2019 05:44 PM
Search the forums and NI.com regarding Modbus. There are several Modbus libraries available that take care of most of the programming for you.
06-03-2019 06:00 PM
Thanks for replying. I am able to develop code for Modbus rtu or TCP/IP but only as stand alone. I am not able to combine the two protocols.
06-03-2019 06:12 PM
Is it Modbus RTU OR TCP/IP. RTU means serial. TCP/IP means ethernet. The heart of the protocol is the same, the difference is the way the messages are packaged and what kind of physical port is being used. (serial vs. ethernet).
06-03-2019 11:45 PM
Thanks for responding .let me try and map the communication flow: PC to gateway physical layer is Ethernet, protocol tcp/ip. Gateway to devices is modbus rtu over zigbee up 10 devices . How write a simple code that will allow me to read data from each of the end devices?
06-04-2019 01:20 AM
Hi,
The computer communicates with the gateway. The gateway communicates with the devices through ModBus RTU. My guess is that the gateway talks ModBus TCP. What happens behind the gateway has nothing to do with the protocol between the computer and the gateway.
It would help if you tell us which gateway you are using. Like RavensFan wrote there are many example and libraries here.
Kees
06-04-2019 11:35 AM
The gateway I am using is ConnectPort X2. IP network to XBee networks.
06-04-2019 11:37 AM
Thanks for help. can you point me to some of the examples you are talking about?
06-04-2019 12:33 PM - edited 06-04-2019 12:33 PM
Download the NI ModBUS library from the Tools Networks using VI Package Manager. The library works very well.