10-28-2019 01:55 PM
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.
Solved! Go to Solution.
10-28-2019 03:40 PM
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.
10-29-2019 02:19 PM
I see.
Is there any tool to test if the commands sent from Labview by Modbus is being received by the device?
10-29-2019 02:30 PM
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.
10-31-2019 11:49 AM
Thank you Jacobson.
You helped me a lot.