Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use MS C++ Socket code to send to a labview socket vi?

See above.
0 Kudos
Message 1 of 5
(4,089 Views)
Are you asking about DataSocket? If so, yes. The Measurement Studio C++ libraries and LabVIEW use the same DataSocket technology, so a LabVIEW application can read from a Measurement Studio C++ writer application and vice versa.

- Elton
0 Kudos
Message 2 of 5
(4,089 Views)
Thanks for the reply. For the DataSocket, you specify an IP address and a tag afterwards. In C++, you specify an IP address and a port number. So how do you map the tag to a port number?
0 Kudos
Message 3 of 5
(4,089 Views)
In C++, you would just set the URL property of the CNiDataSocket object to a URL. For example, if you wanted to read from the National Instruments DataSocket weather server, you could set the URL to "dstp://weather.natinst.com/weather/current". Take a look at the DataSocket examples that ship with the Measurement Studio C++ libraries for some sample code.

- Elton
0 Kudos
Message 4 of 5
(4,089 Views)
No, the VIs you are referring to in LabVIEW use National Instruments DataSocket technology. This is not the same as Windows Sockets communication that you are referring to from Visual C++. They are not compatible to be used together. We do provide libraries for Visual C++ for DataSocket that come with our Measurment Studio package. Measurement Studio includes classes like CNiDataSocket that can be used to communicate with the LabVIEW DataSocket VIs.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 5 of 5
(4,089 Views)