LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket communications

I have a need to communicate data between two applications A & B back and forth.  I am trying use the datasocket for this purpose. However, at this time, Application B does not use any NI tools so would not be using datascoket to receive/send data. App B uses windows based programming and I am wondering if Winsock library functions can be used to access data from the other other end. In my first trial, I did not see any port activity so am not sure if the data was transferred successfully or not.

 

Is there a way that the datasoscket could be setup differently in App A such that it would allow App B to read and send data through TCP using Winsock library functions? How can I confirm if the data is being transferred?

 

0 Kudos
Message 1 of 3
(3,224 Views)

Hello Dwivedi,

 

I do not believe you will be able to communicate with the datasockets if you are not using them on the receiving end. There are 2 different paths you can go for your application:

 

1. Install the support for the Windows SDK for CVI. This can be done by going to Add/remove programs»National Instruments Software and selecting Change/remove. Then select CVI and choose modify. From here you will be able to add the support for the WIndows SDK. Now you will be able to call directly into winsocks on both ends. 

 

2. Use TCP/IP communication for both sides. Here is a good tutorial for getting started with this.

 

Please let me know if you have anymore questions. Have a great day!

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(3,191 Views)

While your other App uses Windows sockets, your CVI app can use the CVI TCP or UDP library to talk to the other App. Most socket programs use either the TCP or UDP protocol (mostly TCP) and based on which protocol the other App is using, you can use the CVI TCP or UDP library. The CVI libraries are sufficient for most TCP or UDP communication. Also, the CVI library will probably be easier to use than the Windows Socket functions.

0 Kudos
Message 3 of 3
(3,165 Views)