Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing C++ to a Labview Cluster Using the DataSocket Server

I am new to LabView so please be patient with me here.

I inherited a PC that is running a large, complex LabView application.  It used to interface with a second PC that also ran labView, and apparently all was good in the world.  The second computer is being replaced with a new system that runs a Visual C++ application which includes Measurement Studio.  I am trying to replicate the data exchange between the 2 computers using Measurement Studios CNiDataSocket class.

Here is the problem.

In the original system, the data exchanged between the 2 computers was bundled into a cluster. Measurement Studio has no utilities that support such clustered data as far as I can tell.  It seems pretty easy to exchange basic data types and button control values, but not so much with the cluster data.  I have tried to fake it by looking at the network packet data format, but I got no where with that.  I really don't want to mess with the legacy LabView code if I can help it.  I am acutally considering building a small LabView client on the LabView machine that exchanges the data in the "unbundled" form, bundling it up, and sending it off to the DataSocket server.  That, of course, will take a fair amount of LabView learning curve which I am trying to avoid.

Anyone have a better idea?
0 Kudos
Message 1 of 3
(5,988 Views)
Hi schlew,

Unfortunately your initial suspicions are correct.  There is no direct way to read a cluster data type in a C++ environment using Measurement Studio data sockets.  There are a couple of different options to read the cluster in.  Probably the easiest is the one you mentioned of creating a client within LabVIEW that reads that data from the data socket connection and parses the data into the individual elements.  It would be possible to build a dll out of the LabVIEW code so you could call this directly within your C++ code.  Here is a link to a KB that explains how to call a LabVIEW dll from C++.  As far as creating the dll itself, it is very similar to creating an executable, but in your build options you select to build a dll.

The other option that requires a little more work would be to modify the original LabVIEW code so that it is sending a byte array, and then parse the byte array on the receiving end in the C++ code.  Hope this helps!
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 3
(5,963 Views)
Pat,

While not the answer I was hoping for, it does help alot 

Thank You!

Schlew
0 Kudos
Message 3 of 3
(5,959 Views)