NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Import table in Excel into TestStand array variables?

I'm trying to use the property loader to read in an Excel file and create a number of local variables.  The tables that I maintain in Excel are of the following format:

Range Setpoint High Limit Low Limit
5 -4.5 -4.49395 -4.50605
5 0 0.0011 -0.0011
5 4.5 4.50605 4.49395
250 -225 -224.6975 -225.3025
250 0 0.055 -0.055
250 225 225.3025 224.6975

 

 From this table I want to create 4 local variable arrays in TestStand, all 6 elements deep: Range, Setpoint, HighLimit, and LowLimit.  Is there an elegant way to do this without having to use all the formatting syntax that would be in a generic export of these locals from TestStand to an Excel file (i.e. using the method of export Excel file, fill in your own values, then import the Excel file)?

0 Kudos
Message 1 of 4
(5,427 Views)

I've only done it in exercises, but you should be able to use a property loader step to your local variables. You can choose from a few different file formats.

 

property loader step.png

 

StephenB

0 Kudos
Message 2 of 4
(5,395 Views)

To rephrase my issue, I want to be able to store my Excel file data in style of table from my first post and not like TestStand's "preferred" formatting as shown here:

IFTDCVInputStart
<Step Name>
   
<Locals> Variable Value
HighLimit <Prop Name='HighLimit' Type='Array' LBound='[0]' HBound='[5]' ElementType='Number'><Value ID='[0]'>-4.49395</Value><Value ID='[1]'>0.0011</Value><Value ID='[2]'>4.50605</Value><Value ID='[3]'>-224.6975</Value><Value ID='[4]'>0.055</Value><Value ID='[5]'>225.3025</Value></Prop>
LowLimit <Prop Name='LowLimit' Type='Array' LBound='[0]' HBound='[5]' ElementType='Number'><Value ID='[0]'>-4.50605</Value><Value ID='[1]'>-0.0011</Value><Value ID='[2]'>4.49395</Value><Value ID='[3]'>-225.3025</Value><Value ID='[4]'>-0.055</Value><Value ID='[5]'>224.6975</Value></Prop>
Range <Prop Name='Range' Type='Array' LBound='[0]' HBound='[5]' ElementType='Number'><Value ID='[0]'>5</Value><Value ID='[1]'>5</Value><Value ID='[2]'>5</Value><Value ID='[3]'>250</Value><Value ID='[4]'>250</Value><Value ID='[5]'>250</Value></Prop>
Setpoint <Prop Name='Setpoint' Type='Array' LBound='[0]' HBound='[5]' ElementType='Number'><Value ID='[0]'>-4.5</Value><Value ID='[1]'>0</Value><Value ID='[2]'>4.5</Value><Value ID='[3]'>-225</Value><Value ID='[4]'>0</Value><Value ID='[5]'>225</Value></Prop>
   
<FileGlobals> Variable Value
   
<StationGlobals> Variable Value
IFTDCVInputEnd
0 Kudos
Message 3 of 4
(5,378 Views)

Hi, 

 

have you ever thought about doing this with SQL-Step Type?

When using this you are compelty free of desgining you table.

The only disadvantage is that you need at least 5 steps to this.

1.) Open Connection

2.) SQL Statement.

3.) Loop that fills your array

4.) Close SQL Statement

5.) Close Connection.

 

 

Regards

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 4 of 4
(5,301 Views)