NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I copy datas from *.xls file with property loader into an array in teststand

Hello,
I want to load limits from *.xls file with the property loader into teststand. I have created a array in loacals in which I want to copy the limits from the *.xls list. How can I adujst the property loader that the datas which were loaded from the *.xls are stored in the array?
kind regards
samuel
0 Kudos
Message 1 of 15
(5,963 Views)
Hi,
 
Here is an TS3.0 sequence file example loading from an xls sheet into a Local array of numbers.
 
Initially the has been set to a size of 6 ([0..5]) and each of the arrays elemants contain 0.
 
I have a meesage popup that displays the contents of elements 0 from the two local arrays.
 
Hope this is of help
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 15
(5,946 Views)

Thank You Ray,

but how can I do this with a Array with two dimensions?

regards Samuel

0 Kudos
Message 3 of 15
(5,941 Views)
Hi Samuel,
 
Exactly the same way as for a 1D array.
 
so in your limit file for example you would have something like this:
<Locals>                              Variable Value
Channels[0][0]                              5
Channels[1][0]                              30
Channels[0][1]                              5
Channels[1][1]                              31
.......and so on
 
In the property loader, you will have a entry for each of the elements you want to load from the file.
eg Locals.Channels[0][0], Locals.Channels[1][0] etc
 
Hope this is clear (I'll redo my example later on to day)
Regards
Ray Farmer

Message Edited by Ray Farmer on 08-25-2005 10:28 AM

Regards
Ray Farmer
0 Kudos
Message 4 of 15
(5,941 Views)

Ray,

but with a array with two dimensions I have the indizes Problems. what should I type where the red "?" are in my attached *.xls file

regars samuel

0 Kudos
Message 5 of 15
(5,935 Views)

Samuel,

as below

<Locals>

load_spec[

0][0]

1

 

load_spec[0

][1]

2

 

load_spec[0

][2]

3

 

load_spec[0

][3]

4

 

 

 

load_spec[1

][0]

2

load_spec[1

][1]

2

 

load_spec[1

][2]

2

 

load_spec[1

][3]

2

 

 

Regards

Ray.

Regards
Ray Farmer
0 Kudos
Message 6 of 15
(5,933 Views)

yes Ray I understand you, but my real *.xls list ist much more bigger and I can´t spend a description for each member of the array.

I wan´t to use the structure from my *.xls file

is that not possible?

0 Kudos
Message 7 of 15
(5,934 Views)

Hi,

srapp,

what version of TestStand are you using?

In TestStand 3.1 you can import/export arrays and containers as xml strings using the property loader.
In previous versions of teststand you have to specify each element of the array you want to export/import.

The easiest way to create your source file (excel file containing the data) is to use the Import/Export properties tool.
Go to Tools->Import/Export Properties and select the properties (array) you want to export.
Specify the file location and as a format select Excel File.
Go to the properties tab a select the properties you want to import/export.
Click on the export button and the tool will create for you the excel file.
You can then edit the file and set it to contain the values you want.

Hope it helps.

This post could help

http://forums.ni.com/ni/board/message?board.id=330&message.id=7578#M7578

Antonio Lie.

0 Kudos
Message 8 of 15
(5,921 Views)
Antonio,
I have teststand 3.1
you said that it is not necessary to specify each element of a array in teststand 3.1
how can I implement this.
I want to import in teststand the attached *.xls list
what should I insert where the red "?" are?
 
thanks to You
 
Samuel
0 Kudos
Message 9 of 15
(5,892 Views)

Samuel,

I am attaching an example.
It consists of a sequence file and an excel file.
There are two local variables in the sequence file, Array1 and Array2. Both arrays have 2 dimensions ([0..2][0..2]).
I am using a Property Loader Step Type to load the values in the "MySourceFile.xls" file into the arrays.
If you check the property loader configuration, you will se that for Locals.Array1 I selected the array itself and that for Locals.Array2 I specified every single element of the array.
Now open the excel file and you will notice the difference. By specifyng the array by itself the result is an XML string and the value of the elements are inside <Value ID='[?][?]'>1</Value>. If you want to modify the values you only have to change the corresponding element.
For Array2 you get the name of every element in the array (I configured it to be this way). To change the value, you only modify the value corresponding to the corresponding element.

Hope It helps.

Message Edited by Antonio Lie (NI) on 08-29-2005 04:27 PM

0 Kudos
Message 10 of 15
(5,889 Views)