From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

how to call LabVIEW_VI in VBScript(activex Com server) with (ByVaL, ByRef)parameters

Hai to all,

i want to call LabVIEW_VI(Activex Server) from VBScript. That VBScript include onther COM Server. i want to data exchange between VBScript and LabVIEW. That parameters shouldbe two types, I mean some parameters ByVal and some ByRef.
How can i call?
Request: How to create VI function with ByRef parameter in LabVIEW.
ex: in 'C++': LabVIEWFunction(short* numb1, CString* str1).
Note: i am using LabVIEW 7.0 Express.

Thanks for advance!
0 Kudos
Message 1 of 11
(3,567 Views)
Hello reddys,

No, unfortunately this is not possible. Parameters are always passed byvalue to VI Inputs.
If you are using the VI-object method SetControlValue(controlName, value)
the controlName is the string Name of the front panel control. The value variant has to be numeric, Boolean, string, or array. A cluster in LabVIEW is represented as an array of variants in ActiveX.

The same is true for the Call method - with the only difference that you have to pass an array of Control names and an array of values to that function.

It seems that LabVIEW internally accesses this array with pointers to get and set the different values.

Ingo Schumacher
National Instruments
0 Kudos
Message 2 of 11
(3,567 Views)
Hello,
Ingo Schumacher
National Instruments

Thanks for your reply,

i will explain what i need, i want to call LabVIEW function with some parameters from vbscript, and i have to get new parameters from LabVIEW. In LabVIEW function posible to send back new values to vb script.
is it posible?

thanks
reddy
0 Kudos
Message 3 of 11
(3,567 Views)
Hello.

I am not sure if I understand correctly. Sure, you can access both controls (inputs) and indicators (outputs) with the LabVIEW ActiveX server. If you use the call function i mentioned in my last answer, you might pass two arrays to the function. One array with the control/ indicator names and another one containing the values. After calling the VI you will find the data of the VI outputs inside the values-array.
Have a look at the attatched ZIP file. It contains a simple example showing the procedure.
0 Kudos
Message 4 of 11
(3,567 Views)
Thanks for your reply,

its verynice.
it is fine, but VBScript is incomplete ....?
any way thanks once again, are you from germny?
0 Kudos
Message 5 of 11
(3,567 Views)
The script should be ok like that. It is running fine on my PC. Make sure that the labVIEW VI is saved at the autodriveuser path. If you cannot open the VI let me know, I am not sure in which version I saved it - maybe it is too new for your LabVIEW Version

Sorry, I just realised that the script is commented in german. I hope you still understand how it works.

Regards
Ingo Schumacher
0 Kudos
Message 6 of 11
(3,567 Views)
Hai ingo,

i am getting script error?here i am attaching that error can see. and i am using LAbVIEW 7.0.

thanks
0 Kudos
Message 7 of 11
(3,567 Views)
thanks, sorry
it is working fine.

thanks
sudheer
0 Kudos
Message 8 of 11
(3,567 Views)
Hai Ingo,

One more request from you, is it posible to call LabVIEW from TestDirecotr8.0, what you gave script will work? if it will work how give the procedure.
or any other procedure is there?

i want to excecute this script in TestDirector8.0.

thank alot
reddy
0 Kudos
Message 9 of 11
(3,567 Views)
Sorry, I am not familiar with that Software. But as long as it supports VBA or VBS it should work similarly.
0 Kudos
Message 10 of 11
(3,567 Views)