12-29-2008 07:46 PM
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.
12-30-2008 09:32 AM
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
12-30-2008 12:06 PM
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 )?
12-30-2008 01:21 PM
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
12-30-2008 01:33 PM
Here is the attachment.
Sorry
02-19-2010 05:59 AM
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?
02-22-2010 12:44 PM
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.
02-23-2010 12:00 PM
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.
02-24-2010 10:13 AM
01-11-2023 08:46 PM
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