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: 

Problems with LV Variant data in step type

Hi,

I have made a custom step type that contains some LV Variant data in the properties. For this purpose have I made a container (without any sub properties) in my step type to store the Variant data returned for LV when running data from my edit mode. But the data returned to TS is not stored in my step type. Why?

When I return the data to a local variable in TS the data in my variable is updated correctly.

I have made a little test application to show my problem. Extract the ZIP file to “C:\” Open “C:\VariantTest\VariantTest.seq”.

This sequence contains a custom step type called “Action (VariantTest)”. This step type calls “VariantTest.vi” in edit mode (right click on step and select “Edit Variant Data…”) and in run mode. This VI returns variant data to Step.Variant and Locals.Variant. When the code is called, In both Edit and Run mode, only the Locals.Variant is updated with my variant data. Why?

Please help me.

Morten Pedersen
CIM Industrial Systems A/S
0 Kudos
Message 1 of 3
(2,924 Views)
I believe the reason that the value is not getting to the step.variant is because you are trying to pass it into a container. You are passing the local as a string and this one seems to work so I would try passing the step as a string as well. There is more information on this topic at:
http://forums.ni.com/ni/board/message?board.id=330&message.id=890&requireLogin=False

TestStand does not know what the type of the variable is since you have it as a variant and then a container. Try a string and let me know how this works.

Also, is there any reason that you have variant as step.variant instead of step.result.variant. This probably is not a big problem but you usually want to store results in to the step.results area.

Regards

Anders M.
NI Denmark
0 Kudos
Message 2 of 3
(2,913 Views)
Hi Morten,
TestStand does try to figure out the type of the variant and tries to change the type of the TestStand variable to match the type of the variant. If you change your local variable in your example sequence to a number or a container, it gets replaced with a string because the variant contains a string.

The reason the value of the variant is not stored in the subproperty of your custom step type is because the type of the subproperty cannot change to match the type of the variant. To allow this type change, change the subproperty to be unstructured. This can easily be done by setting the flag PropFlags_UnstructuredProperty in the subproperty.

To do this, go to the step definition (in this case VariantTest Step Type) and open the properties dialog of the subproperty. Press the Advanced... button to open the Edit Flags dialog. Scroll down and find PropFlags_UnstructuredProperty. Check its checkbox and close all the dialogs by clicking the OK button.

Try it and let me know.

Regards,
Jose
0 Kudos
Message 3 of 3
(2,904 Views)