Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating with a Host VI from a C or C++ application - should I use Measurment Studio?

For background, I'm very new to LabView, but experienced with Visual Studio and C/C++.  So forgive me if this is a simplistic question.

Using the LabView FPGA module, I can build a Host Vi and corresponding FPGA VI for the target.  I already have an established C/C++ application that interfaces with a variety of NI boards, and I want to add the FPGA to the mix.

My question is what is the best way to pass data between the C/C++ app and the Host VI.  I was told that Measurement Studio would be a good candidate for this scenario.  In other words, my app using Measurement Studio add-on communicating with the Host VI which in turn interfaces with the target FPGA VI.  But what I can tell from my 1 hour of looking at Measurement Studio, it looks like this is used to acquire, analyze, and present measurement data, as opposed to what I want to do, which is more or less, run my Host front panel from my C/C++ application.

So, am I missing something about measurement studio, or should I be using something more like using TCP/IP or sockets?

I'll summarize with asimple example...Suppose my Host VI takes an intial count value (via a numeric control) that will be used in the FPGA VI.  What's the best way to pass that count value from my C/C++ App to the Host VI, and return any output data back to my App?

Thanks,
RP

0 Kudos
Message 1 of 3
(7,272 Views)

Hi RP,

Using TCP/IP is probably the most straightforward way to do the communication.  There are a number of TCP/IP examples in LabVIEW.  Another way would be to use ActiveX or .NET.  For more information on using ActiveX, see Calling LabVIEW VIs from Other Programming Languages.  Measurement Studio is not necessarily going to be better for this scenario.

Regards,

James R.
National Instruments
0 Kudos
Message 2 of 3
(7,230 Views)
Hi RP,

Measurement Studio does also contain the Network Variable Library (equivalent to the LabVIEW shared variable) that you can use to communicate between your LabVIEW VI and your Measurement Studio application.

Now I must mention that the Network Variable API is only available .NET languages (i.e. C#, VB.NET, C++/CLI) so I am not sure if it totally applies to your situation. You could also look into using DataSocket which is the precursor to the shared variable.  If you are using unmanaged C++, you could use the Measurement Studio DataSocket C++ class libraries. 

Just thought I would throw that out there.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 3 of 3
(7,155 Views)