LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi connect ethernet device

I use a category of PLC which uses ethernet port as the communication interface . Now plan to develop the comunication app. using CVI , I'd like to know can I just use the "TCP Client" functions to program the communication application ? Please give an advise . Thanks.

David
0 Kudos
Message 1 of 4
(3,633 Views)
Hi David,

If the PLC has a server application to allow you to connect and accept data, then yes, the client TCP functions will work fine for you. However, if it doesn't have the server application, then you'd have to develop the server yourself in CVI using the Server Functions. There are example programs that come with CVI that can help you along and get familiar with the Client/Server function calls as well. Just open NI Example Finder (under Help >> Find Examples) and search for TCP. Hope this helps!
Jeremy L.
National Instruments
Message 2 of 4
(3,617 Views)
Hi Jeremy,

Do you means that I have to program a server function on my PC if there is not any TCP server functions ? I hope the TCP server would be bulit in the PLC , but the cvi based application can not download to it . Assuming that there is not any TCP server built in the PLC , can I use a PC based TCP server represent the PLC site application ? Thanks.



David
0 Kudos
Message 3 of 4
(3,605 Views)
Hi David,

I took some extra time to research a little more about PLC ethernet devices, and found that those devices actually communicate through an OPC server. This server is the intermediary between your client application and the PLC. So, ideally what you want to do is connect and transfer data through an OPC server connection. To do this in CVI, you would actually need to use CVI's DataSocket Protocol. There is a library in CVI to perform DataSocket, and there are also links on our website to tutorials and knowledgebases. Here's a link to some search results that can point you to resources:

Search Results for: cvi opc datasocket

Hope this helps!
Jeremy L.
National Instruments
0 Kudos
Message 4 of 4
(3,593 Views)