NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

VARIANT data in TestStand

I want to control a program using ActiveX in TestStand. I can successfully obtain a reference to the VI object in the program. The server program was written in LabView and allows the Call method of ActiveX to control the program. The Call method requires two parameters. Both are of data type VARIANT (parameterNames, parameterValues). The parameterNames are basically strings, but the parameterValues are mixed type(string, int, bool,etc).

Is there a way to create a data type of VARIANT in TestStand to pass data through the ActiveX adapter??


Note that I can do this in LabWindowsCVI, but I was trying to avoid writing a special DLL and use the TestStand Adapter.
0 Kudos
Message 1 of 4
(4,854 Views)
Hello,

There is no way to create a VARIANT data type in TestStand. If one of the methods of the server accpets a VARIANT data type and the type is a supported ActiveX type (e.g. Array of BSTR) then you should be able to pass the data into this parameter as usual (e.g. an array of strings). However, if you are trying to pass a container into a VARIANT type, then this will not work, since this data type is not a supported ActiveX type.

The question is, how are you creating an ActiveX server in LabVIEW, and what do you mean by mixed type?
0 Kudos
Message 2 of 4
(4,854 Views)
The server application is from a vendor. His appication is written in Labview and he provided a VI to control it with ActiveX. The parameter names are all strings so I can pass an array of strings to it i.e. "Command","Success?","Pass?","Margin",..... The parameter values are an array of variant i.e. "run", FALSE,FALSE,0.0,NULL,NULL,NULL,NULL.

I can create funcitons to do this in CVI using the ActiveX functions. I guess TestStand can't handle it. I don't undertand the point of having the ActiveX adapter in TestStand if it can't handle sending data to/from an ActiveX server.
0 Kudos
Message 3 of 4
(4,854 Views)
Bob asked what you meant by mixed data types. To clarify, the LabVIEW ActiveX server has a call method. It's second parameter is a varaiant array of variants, where the elements can be different (mixed) data types. Each data type corresponds to the LabVIEW control specified in the first parameter of the Call method, which is a variant array of strings.

As Bob explained, the ActiveX automation adapter is able to automatically convert TestStand properties to variants, when the data type of the properties are support ActiveX data types (e.g. most scalars and arrays of these scalars).

For the first parameter of the Call method you can send in an TestStand array of strings. This array will automatically be converted to a variant array of BSTRs be
fore being passed to the Call method.

Currently TestStand does not support a variant data type. Therefore, it is impossible to create an array of variants so that the array can in turn be converted to a variant by the ActiveX Automation adapter.

In general, the ActiveX automation adapter does handle sending data from/to an ActiveX server. The issue of passing arrays of variants has not occurred very often. We have encountered it once internally at NI, but I believe that you are the first customer to ask about passing arrays of variants.

In terms of the big picture, I don't understand why you are calling a VI using the AcitveX automation adapter instead of the the LV adapter. If the vendor has already created a VI to call another VI through the LV ActiveX server (why does he/she do this?), then perhaps you should just call the vendor's VI directly.
Message 4 of 4
(4,854 Views)