From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus ethernet communication

Solved!
Go to solution

I am still newbie in NI.

I have a task to establish modbus ethernet communication between labview and a controller.

From the material which I read, there are two options to achieve it: Shared Variable and Modbus library (Modbus Master and Slave). However, I am not sure what is the difference between these two.

Anyone can explain to me about differences and benefits of having one option over another. Thanks

0 Kudos
Message 1 of 4
(2,433 Views)
Solution
Accepted by topic author rt089

MODBUS defines a communications protocol, that generally isn't specific to the communications mode. Shared Variables are a LabVIEW component that allows data to be passed between LabVIEW VIs without the normal intervening LabVIEW "wires", with the unique aspect, at least in LabVIEW, that these VIs can reside on different machines, connected by a network.

 

Now, there might be a method to "encode" or "decode" your modbus command and have it passed between LabVIEW programs running on multiple machines (requiring LabVIEW running on both ends) to communicate with whatever device you are trying to communicate with, but if you use the MODBUS library, you only need one computer running LabVIEW, the MODBUS "messages" are encoded to go to whatever remote ethernet enabled MODBUS device (PLC or other controllers). Presumably that remote device has an ethernet interface that allow MODBUS communication.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 2 of 4
(2,398 Views)

I recommend using this MODBUS library with LabVIEW (note that the download link is to the right, not at the bottom or in the article).

 

There are a few other MODBUS libraries out there but I tried 3 different ones and this is the one that gave me the least amount of problems.

0 Kudos
Message 3 of 4
(2,396 Views)

And read the articles about LabVIEW Modbus. Modbus can be odd in addressing, etc. Overwrote an address in a not very robust device, bricking the particle counter. To the manufacturer's credit, the only charged us shipping to fix.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 4
(2,394 Views)