NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant data in Teststand

Well, This is a bit of a design question.

 

I have an application with many different type of step thats require different parameters. For exemple, on test could only use a string and another could use some arrays and booleans. These tests (could be in any order) and parameters are loaded from a configuration files (text-based). The sequence is builded dynamically in teststand and the differents steps are added to the sequence depending of the order that they are found in the configuration file.

 

My question is: What would be the best way to hold all the parameters in the teststand memory. I was thinking of a array of 'variant' (coming from LabVIEW) but I can't do the convertion (Variant to string for exemple) inside Teststand.

 

Another way would be to create a new type (MyType.ini) of data for every different test type. I'm not sure if it's a good way since there is several different test. I would have to output many different cluster for my configuration parser.

 

Any idea of how to do this in a elegant way?

 

Thanks in advance!

 

John

0 Kudos
Message 1 of 4
(5,119 Views)

Hi strobist,

To store the data in TestStand memory, you could create a code module that creates variables using the NewPropertyObject method of the TestStand API.  With that method, you could assign the type according to what you read in from the configuration file, and be sure to set InsertIfMissing to true. 


Mark E.
National Instruments

0 Kudos
Message 2 of 4
(5,080 Views)

Thanks for the answer!

 

So what you mean is to create one big cluster with all the configuration in it? It would be better to have an array of cluster but since the configuration is diffrent for each kind of test, this is not possible...

 

I have attached an image to illustrate the kind of configuration that would be found.

 

Are the elements in a TS container are ordered the same way that they are in a LabVIEW cluster

 

What I was thinking was to get all the configuration parameters as string. So I would have an array of cluster containing 1 string (type of test) and an array of string representing the parameters. The convertion from string to 'the right kind of data' would be done into the test steps (mostly VIs).

 

Thanks again!

0 Kudos
Message 3 of 4
(5,067 Views)

Hi John (strobist),

 

We also pondered this issue for a while and in the end we decided to read in the data from Excel and dynamically (programmatically) create the parameters and store them in a container. Each parameter from the file is also a container which has three variables to represent the parts (as Frequency shows below).

 

So - these parameters are read in and created every time the sequence is run - twice. Once for the runtime context, and once so that they remain after the run is over. That way it is easy for the developer to use the variables when creating TestStand steps.

 

In the image below, the container 'xl' was created at runtime by reading from file.

 

As the programmer you can choose the order in which to create the objects.

 

You've probably done it already, but if you search for programmatically create variables / parameters etc. you'll come up with a whole slew of info.

 

Hope this is of some help,

 

Ronnie

 

CropperCapture[49].Png

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 4 of 4
(5,039 Views)