LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting clusters from LabVIEW ActiveX Server with Excel/VBA

Hello,

my colleague and I are trying to control a LV from Excel (VBA) by ActiveX.
I.E.:
We do something like :
-------------------------
Set LV = createObject("LabVIEW.Application")
Set VI = LV.GetVIReference("Path_to_VI")

ParamNames(0) = "Input1"
ParamNames(1) = "Input2"
ParamNames(2) = "Output"
ParamValues(0) = 1
ParamValues(1) = 3.1415
Call VI.Call(ParamNames,ParamValues)
msgbox("output =" & ParamVals(2))
-------------------------------
This works perfectly for simple data types (int, double, float, string, etc )
Now we need to transfer more complex structures, which are originaly LV-clusters.
But we did not find any clue on how do that (especially receive clusters) in the help or on the internet.

Is there any chance to succeed ???

TIA,
Thomas
0 Kudos
Message 1 of 3
(2,983 Views)
I've never tried it myself, but I believe you're suppose to use the variant type. At least that's what the documentation says. You're supposed to get an array within VB, so you access the individual elements of the cluster as elements of the variant array. This thread seems to imply that, given the example given in the last post. True, it uses a LabVIEW DLL, but the concept should translate to the ActiveX Server.

Message Edited by smercurio_fc on 05-25-2007 09:24 AM

0 Kudos
Message 2 of 3
(2,977 Views)
Actually, working with clusters is really really easy. Through the magic of - well something - a cluster in LV comes out in the VBA environment as an array of variants. There was an activex example that shipped with V7.1 that showed this very thing. I couldn't find them in V8 so here is the 7.1 stuff.

Check out the macros in the Excel spreadsheet... This show running the VI in the development environment, but if this looks interesting I can fill you in on how to make it work in an executable.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Download All
0 Kudos
Message 3 of 3
(2,966 Views)