NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can the Property Loader load arrays of variable size?

I need to run a series of tests on the same UUT, changing only one parameter at a time (for example, a frequency response test). The hardware developers would like to be able to change the values of parameters of the test at will, without making changes to the sequence. That's easy - just change the value of the parameter in the Properties file. The hard part is changing the number of iterations of the test, by ONLY adding or deleting the number of parameters from the text file. In other words, all I know during sequence editing is the types of parameters, not the values or how many. I want the test to loop as many times as there are sets of parameters in the text file.

I would like to do this by loading the paramet
ers as an array. But the Property Loader wants me to specify each variable while I am editing the sequence, including each individual member of the array (e.g. "Locals.Array[0].Value"). I want to do somthing like "Locals.Array[*].Value", where "*" means "all elements".

Am I forced to write external code to load each parameter, or does TS have a native way to do this? Even better, has anybody done this already, and will you explain how? Thanks
0 Kudos
Message 1 of 3
(3,235 Views)
Hi,
there's a couple of options here, and I've included what I think is the simplest below (using TestStand 2.0.1).
It's not exactly elegant though. What I've done is to put in a step that finds out the number of steps to load (based on an earlier decision - in this case a message popup step). I read a number from the limits file, and use this in the looping options of the property loader step that's loading the values into the array. I've done it with a fixed size array target here, big enough to take any incoming data. (Otherwise, knowing how many items you're going to load from the limits file, you could start with an empty array and re-size it prior to loading).
I've cheated slightly by using the pre-expression on the property loader step to specify where th
e data is coming from and where it's going to in the sequence on each iteration of the loop based on the Runstate.Loopindex.

Another option is to go straight into the property loader step, and keep loading properties until the Step.Result.NumPropertiesRead = 0 (remember we're only doing this one at a time)

Another idea would be to load in a value, and check it isn't a "flag" value (i.e. you'd never use say 999 in your array, so set the last element in your limits file to this, and drop out of the loop when this happens.

Further still, you've got the source code for the property loader step, so you could re-write it to make a custom step that loads an array until it fails all on its own (no looping in TestStand).

Hope this gets you going

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(3,235 Views)
Hi - oooops - completely forgot about the limits file. You'll need to put this in C:\windows\desktop to work with the above example sequence file.

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 3 of 3
(3,235 Views)