From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is my approach correct?

hi all,
i am now developing a activeX system which is let the C++ program to call Labview ActiveX server. However I am really doubt if my approach is correct. So now i develop a very simple activeX system that reading a number in C++ console mode and then C++ call labview reference and pass the number in labview server via VI reference and call method. Can everyone give me some suggestions?
(1) for C++ program, i have modified the source node from the code example. I just modify the path of VI and some very basic call.
(2) for LabView, i just simply add the indicator and the variant to data function block. also i have enable ActiveX server for that program. However, I didnt do anything ELSE.
I am really confused if this approach
works. because when i run the exe file from C++, fatal error occur.
So can anyone give me suggestion or the specific idea about how to deal with it?
thanks for help so much.

CowCow
Download All
0 Kudos
Message 1 of 3
(2,222 Views)
When you put:

pVI->SetControlValue("answer", "number");

"number" is the string "number", not your number variable. You would need to convert number into an asci string using something like sprintf. Or, you can use a VARIANT type.

VARIANT number;

number.vt = VT_INT;
cin >> number.intVal;
0 Kudos
Message 2 of 3
(2,222 Views)
I couldn't get your simple server to load up, something about a resource not being available. I've been struggling with Labview myself and I was hoping to use yours as a template. If you do have a version that works, please let me know. Thanx.
0 Kudos
Message 3 of 3
(2,222 Views)