LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How make VI controls accessible to c++ application

I tried to access my VI via ActiveX from C++ just as in one of the tutorials but I failed. The only difference is the VI that I access. The example VI works fine ...

I created a simple VI with a Slider component and wanted to set its value from external application. What do I need to do? Now the app raises exception when trying to perform pVI->Run(0) or pVI->GetControlValue(...) for some reason

The longterm aim is to create a VI that will be controlable from a script (parsed by C++):
turnOn(button1);
wait(1000);
setValue(Slider1,25);
...
Download All
0 Kudos
Message 1 of 2
(2,591 Views)
Hi,

I tried getting and setting the control value of the slide control and the numeric in LabVIEW 7 and it worked fine. I have attached the code that I used.
It is pretty similar to yours except for a few things:
1) You have a '\\.ax.vi' and I used '\\ax.vi' for the path.
2) Instead of using the Variant type I used the actual datatype of the control in LabVIEW.
3) Your while loop if not stopped will continue running and the VC application will keep waiting. Notice the display of printfs

Try using this and see if it works for you. Good luck!

Feroz
Download All
0 Kudos
Message 2 of 2
(2,591 Views)