LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Comunication between Labview and PLC or by OPC UA

Solved!
Go to solution

Hi Guys,

 

I have some knowledge in Labview and I am trying to connect by modbus protocol the PLC and Labview. I intend to use do Labview screen as a supervisory.

 

I made some searches in NI forum, and I found this topics:

 

Modbus: http://www.ni.com/tutorial/13911/en/

OPC server: http://www.ni.com/white-paper/7450/en/

OPC UA : http://zone.ni.com/reference/en-XX/help/376230B-01/opcuatool/creating_opcua_svr_opcua_clnt/

 

The point is I tried to copy each pace presented in this link http://www.ni.com/tutorial/13911/en/ and it did not work. Is there other way to help me solve the problem? I did not try to apply the solution OPC UA, is it better this option? 

 

PLC model: DVP-12SA2

Comunication: Serial

 

Regards.

 

0 Kudos
Message 1 of 5
(3,392 Views)

If you are going to communicate over Modbus, I would recommend downloading the NI Modbus Library off of VI Package Manager. As you have probably found with the I/O server method, if something goes wrong or isn't quite working correctly, it's very difficult to do much about it.  The API is now on GitHub (https://github.com/NISystemsEngineering/LabVIEW-Modbus-API) and throws more meaningful errors from my experience.

 

I think OPC UA/DA can offer advantages if you are connecting to many PLCs or have many clients requesting this data but if you're just doing a single PC to a PLC or two I think Modbus tends to be much simpler to setup and maintain. The NI OPC UA Toolkit also adds an extra development/deployment cost.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 5
(3,364 Views)

I see.

 

Is there any tool to test if the commands sent from Labview by Modbus is being received by the device?

0 Kudos
Message 3 of 5
(3,298 Views)
Solution
Accepted by topic author hugomeshg

Should depend on whether you're doing Modbus over Ethernet or Serial. It's a request-response protocol so if it's over serial, best you can really do is look at IO Trace to see if the correct command is sent out through the correct serial port. There isn't any handshaking so if nothing comes back you can't really tell what happened on the other side or if there's even anything there. If you're doing Modbus over TCP you can wireshark the NIC and see the connection establish and the command being sent.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 5
(3,292 Views)

Thank you Jacobson.

 

You helped me a lot.

0 Kudos
Message 5 of 5
(3,278 Views)