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: 

TS2013: Load Variable Size Array Property Loader

Solved!
Go to solution

I'm trying to set up a property loader to load in test limits from a CSV/Excel file but I want to avoid all of the horrible XML that gets generated.

 

There could be 0..N limits for the different parameters. My local is an empty array of the same type.

 

I want my limits file to look like this:

<Locals>,Variable Value
CLOVER_Drive_Conditions_Limits[0].Parameter_Name,"SOA_Current"
CLOVER_Drive_Conditions_Limits[0].Comparison.Comparison_Type,"GELE"
CLOVER_Drive_Conditions_Limits[0].Comparison.Low_Limit,0
CLOVER_Drive_Conditions_Limits[0].Comparison.High_Limit,100
CLOVER_Drive_Conditions_Limits[0].Comparison.Units,"Amps"
CLOVER_Drive_Conditions_Limits[1].Parameter_Name,"SOA_Voltage"
CLOVER_Drive_Conditions_Limits[1].Comparison.Comparison_Type,"GT"
CLOVER_Drive_Conditions_Limits[1].Comparison.Low_Limit,5
CLOVER_Drive_Conditions_Limits[1].Comparison.High_Limit,0
CLOVER_Drive_Conditions_Limits[1].Comparison.Units,"Volts"

When I run the property loader step, it says 'done' but it doesn't import the items.

 

Any ideas?


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 1 of 5
(3,103 Views)
Solution
Accepted by topic author Sam_Sharp

Hi Sam,

 

I don't know why this is happening for you, but a possible solution might be to do include the array size you will be loading as a property and then do the properly load operation(s) as follows:

1. Load the array size to a local variable using the specific variable properly loader.

2. Change the number of elements of your empty array using SetNumElements () and the array size local value.

3. Load the array elements using the 'Import all Properties from Data Location' option (reloading the array size, but so what).

 

I've used this method in the past to design a one-size fits all property loader function to handle variable size arrays.

 

I hope this helps.

 

-Jack

 

Message 2 of 5
(3,097 Views)
Thanks, I was hoping it would be possible to do it in a single step (I'm developing a test system but want to hand it off to the test engineers to develop the sequences so I was hoping to simplify the sequence editing experience).

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 5
(3,067 Views)
Solution
Accepted by topic author Sam_Sharp

I didn't explicitly say it, but [in theory] you could create a utility sequence that the developer would call with parameters for what property file to call, Markers to use (if not statically defined), and the array to populate, and which would do the three steps internally. So you could at least do it in one sequence call step. I'm sure this can be done, but I can't find my example to verify that what I described above was actually what we did...

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

Yup, that's almost exactly what I ended up doing - creating a sub-sequence in a Utility sequence and creating a custom step type out of that which does the following:

 

2017-04-05_17-49-32.jpg

 

Thanks for the pointers!


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 5 of 5
(3,055 Views)