Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Shared Variable with Visual C++

HI all,

This is the scenario. I am using LabView Real Time 8.5 on PXI and communicate with
a host computer through shared variable (I created a RT project of course).
Currently, I am planning to use the measurement studio 8.1 with visual C++ as the programming language.

My question:
1. How to access the shared variable? Read/Write?
2. Is there any example for this? Please mention the url/sites


Thanks 🙂


Message Edited by bondhan on 07-24-2008 07:47 AM
0 Kudos
Message 1 of 2
(8,844 Views)
Hi bondhan,
 
If you were using a .NET language such as C# or VB.NET, you could use the Network Variable Library in Measurement Studio to talk with the shared variables. This is the preferred method of communication. Note Measurement Studio uses the term "network variable" while LabVIEW uses the term "shared variable" even though they are the same concept.  Even though you mentioned C++, I would encourage you to consider moving to .NET as this is where the Measurement Studio team is devoting resources. 
 
Now, I know it may not be possible for you to move right now, and so you are stuck with C++. If that's the case, you can use DataSocket to communicate to the LabVIEW shared variable. You just need to use the psp URL syntax as described in the KB How Do I Read/Write to a Shared Variable with the DataSocket API?
 
You can find basic DataSocket examples in the following directories (i.e. in this case I am assuming your are using VS 2005)
Vista - C:\Users\Public\Documents\National Instruments\MStudioVS2005\VCNET\Examples\DataSocket
XP - C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\VCNET\Examples\DataSocket
 
Best Regards,
Jonathan N.
National Instruments
Message 2 of 2
(8,816 Views)