NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way for using Property Loader with Excel

I am trying to architect a test system to run a variety of tests (DIO, AIO, PWM...etc) and I noticed that Property Loader can be quite handy. I am trying to find the best method to utilize NI TestStand Property Loader to load test properties from Excel into some sort of parameter database. The properties shall be loaded only once when the test sequence is opened. The parameters of the excel table will have a format like this:

 

TestType TestCondition  ECUPin#   Limits.High    Limits.Low  Units  PWM_Frequency  CAN_TX   CAN_RX

DI            ON                    1                                                                                      0x0102   0x0304

AI            OFF                   2                0             0.1                V                                0x1324   0x0405

 

The table will look much more complex than this one, but once I know how to do this I should be fine. Does anyone have suggestions for what I am trying to do ?

 

Thanks,

Ayman

0 Kudos
Message 1 of 6
(4,846 Views)

There are examples that ship with TS to demonstrate this very thing.  Look in C:\Program Files\National Instruments\TestStand X.X.X.  Once in there folow this path: PropertyLoader\LoadingLimits\LimitsFromExcelFile\UsingCVI and open the seq file.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 6
(4,844 Views)

I already used the supplied example, but it is a basic example. I needed an expert view on this since my excel file will look much bigger and complex than the example. I also want to add to my original post the following:

 

Should I create a parameters container and import all the data from excel via property loader ? Is this the best method ?

 

Thanks,

Ayman

0 Kudos
Message 3 of 6
(4,840 Views)

There are a couple methods of thought here:

 

Property Loader-  You can use the tool to export and import properties.  The best way to do it is to export the properties that you want in the Excel file using the tool.  Then make copies of the file and change the values in there.  This will ensure that once the values come back into TestStand they will all go to the correct place.

 

FileGlobals Method-  You can create a large container which has all the correct variables in it in your file globals or locals.  There is an object in the TS API called a PropertyObjectFile.  This file is a simple text file that contains the properties, sub properties and values of any property object in TS.  You can easily just pass the container into it.  The problem with this is that you then have to create a VI or some tool to edit the values in it.  You can go in there and manually change them but it's not as intuitive.

 

Property Loader to FileGlobal Container-  This would basically be a hybrid of the two.  Pretty much what you described in your post.  Where the property loader only has to load the container in your FileGlobals.

 

 

Which method is best? It all depends on your application.  If you ever need to dynamically export the properties then you can't use the Property Loader. 

 

One thing to remember is that you should only Import/Export properties that need to be changed in the Excel file.  This will help reduce the number of properties. 

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 6
(4,835 Views)

Thanks for your prompt reply. I guess the third option "Property Loader to File Global" is the most suitable because execution time is also important for me, which is why I want to load the properties only once on sequence load. Do you have an example for reading properties from and Excel file via property loader into Fileglobals ?

 

Thanks,

Ayman

0 Kudos
Message 5 of 6
(4,831 Views)

Ayman,

I would suggest method #1 as it is very powerful and will have good performance. Basically what you do is create a working sequence with default values for all of your variables and test limits. Save the sequence and tools>> export. This will allow you to create an excel file and by using the properties tab you can export just about anything that is exposed under the sequence editors variables tab including the station globals and file globals. You only need to do this once. Now with that done insert a property loader step in your sequence and configure it to import the the stuff you want. For each sequence that is similar you can just edit the excel spreadsheet, save it under a different name, and direct the property loader to that new excel file in the new sequence.

 

 The best part is that when you deploy/compile your application on another computer you can change what you have exposed in the spreadsheet without having to recompile.

 

 Hope this helps

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 6 of 6
(4,813 Views)