NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading Array Using Property Loader

Hello All,

 

I am trying to load a column of number from a text file into a local array using the property loader.  I do not understand why it is not loaded (empty). 

I only want to load the column named "EngineRPM" into the array called "EngineRPM".  Thanks.

Download All
0 Kudos
Message 1 of 10
(7,193 Views)

Try this.

 

The rpm array WILL ONLY SHOW VALUES WHILE YOUR SEQ IS RUNNING.

The sequence file will show the array as EMPTY after the sequence stops.

To see the data loaded you will need to put a break point after the load step to see the loaded array. 

 

Next time load the array manualy and then use the inport\export tool to export the data to see the format the file needs to be in. 

Use the file the export tool creates as a starting point for your property loader file. 

 

Omar

Omar
Download All
Message 2 of 10
(7,179 Views)

Thanks for the tip about the import/export.  That really helped.

I have also  found a document explaining how the text file should be formed:

http://digital.ni.com/public.nsf/websearch/2A4CA675B86CF70986256C2B00558D9A?OpenDocument

 

But, here my question now is:

1.  In the example that came with TestStand (LimitsFromTextFile.seq), the text file doesn't contain any of the tags.  Why does that file work?

2.  So does following the format as suggested mean I can't have multiple columns of data (like people usually do in a excel spreadsheet )?

0 Kudos
Message 3 of 10
(7,172 Views)

The property loader has defined format to load data with. TestStand does support an Excel file format. See attached file.

 

The file "ExampleLimits.txt" that you referenced contains limits for two different types of tests Commercial and Military based on the "Start of Data Marker" of the property loader setup.

 

In each section, are rows for each test step that needs limits loaded.

 

The rows contain columns with the data that is loaded for each step name that is listed. Any step property can be loaded, just include a column with the correct property name as a header. This is a 2 dimension table

 

For example

[col 1] Step name or label = "Test Voltage at Junction A"

[col 2] Limits.Low              =  "9.50000"

[col 3] Limits.High              =  "10.5000"

[col 4] Limits.String            = <blank> no data is included

 

In the example I sent you, your array data was contained in a section <Locals>. To get the data in your local variable you need to tell it which variable to put it in.

 

The line 

EngineRPM <Prop Name='EngineRPM' Type='Array' LBound='[0]' HBound='[10]' ElementType='Number'></Prop>
Create the size of the array to recieve your data. If the array is empty the load will fail. Or if the data extends past the size of the array.

YOU must make sure the array is sized correctly before the data is loaded.

 

Omar

Omar
Message 4 of 10
(7,165 Views)

Here is the attachment.

Sorry

Omar
0 Kudos
Message 5 of 10
(7,163 Views)

Hi,

 

Could you explain me why that method (using Property Loader to load data ino array) works only if  TickBox called 'Import All Properties  from Data Location' is ticked? What if I'd like to to import only that one local variable (array) in which I'm interested in?

 

Otherwise, when I choose my one specific property I'm interested in numbers are not load (0 - defaulf value), however arraysize will change and TS won't throw any error.

 

Why?

0 Kudos
Message 6 of 10
(6,630 Views)

Hi Mimi,

 

I just created a quick sequence file and used a Property Loader step to import just one local variable from an export file containing 50 different data entries. The single-variable import worked properly. Perhaps your data file is incorrectly formatted?

 

Attached you'll see the sequence file (with a Property Loader step) and the exported values that I used.

Warm regards,

pBerg
Download All
0 Kudos
Message 7 of 10
(6,595 Views)

Hi pBerg,

 

Thanks for example.

 

You're right. Everything's fine unless I'm not loading array of containers into predefined empty object of exactly the same type.

 

So far I found that you can first create a template of format using import/export feature and then edit values in that type definition returned by export function.

 

However, I'd like to be able to do thay in style you presented (more readable, dot and brackets notation) rather than xml style.

 

0 Kudos
Message 8 of 10
(6,561 Views)
Apologies, I'm not sure I follow you. Could you maybe elaborate on what it is that you want to do and the problem you have in doing it? We'd be happy to do what we can to help.
Warm regards,

pBerg
0 Kudos
Message 9 of 10
(6,540 Views)

carrie1993_0-1673491333035.png

carrie1993_1-1673491490675.png

 

Hello, I use the import/export tools to export the variable to txt, and then add maker on the txt, but when I execute Property Loader, there will be an error, please help me to have a look 

0 Kudos
Message 10 of 10
(2,289 Views)