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.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I pass a Variant to a C++ DLL from TestStand?

I have a VARIANT that is being returned to TestStand via COM. The variant contains a structure of integers and strings. The integers are not uniformly sized... some are 8,16, and 32 bit. Rather than try to find a way to decode this information in TestStand, I would like to pass it to a C++ DLL to do the decoding and return the information in a readily usable format. I also have need to take the aforementioned data types, send them to a DLL for conversion into a VARIANT, and then pass this variant to a COM object. Can someone please explain a way that I can use TestStand as a pass-through for VARIANTs between a COM object and a C++ DLL?
0 Kudos
Message 1 of 2
(2,776 Views)
Hi,

To pass a VARIANT to a C++ DLL in TestStand, you will need to create a custom data type.  From the sequence, change the View ring to Sequence File Types.  Right-click to insert a new Customer Data Type and select Container.  Now you can right-click to insert a field, which you can specify what data type it is.  Insert as many fields as needed.  After you have entered those in, right-click on the Custom Data Type name and select Properties.  Go to the C Struct Passing tab and click the "Allow Objects of this Type to be Passed as Structs".  Change packing to correlate with the C++ compiler you are using and also configure the properties for each field.

Once you have done this, you will be able to pass that VARIANT as a struct to a C++ DLL.
0 Kudos
Message 2 of 2
(2,757 Views)