NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Create variables in TestStand with the PropertyLoader

Hello,
 
I whant to read several csv-files with the property loader of TestStand 3.1 (all FileGlobals or StationGlobals). The problem is, if the variable doen'st already exists the property loader doesn't work.
The variable I am ready in the CSV-file are alway different and I can't create manually the variable at first in TestStand or in the sequence file, before I can load them with the property loader.
Is there a possibility to create dynamically variables (Globals or Locals) with the PropertyLoader? If not, what can I do?
 
Cheers,
Risotto
0 Kudos
Message 1 of 4
(3,733 Views)

Rissotto,

What are you exactly trying to do?
You are right, If the variable does not exist you will get a run-time error.
What are you using your variables for?
Take a look to the following post:
http://forums.ni.com/ni/board/message?board.id=330&message.id=8395#M8395
If you have any question let me know.

You usually use the property loader in order to override the value of an existing property.
You want to override the value of a property in order to change the settings of your test (type of test).

It is possible to create variables dynamically but I would like to have more details on the problem you are trying to fix to help you find the best solution.

Antonio Lie.

0 Kudos
Message 2 of 4
(3,714 Views)

Antonio,

Thank you for your answer. I read and understood the post http://forums.ni.com/board/message?borad.id=330&message.id=8395#M8395.

Anyway, this still not really helps me. I will try to explain my problem:

We are actually upgrading from TestExec to Teststand/Labview. For our products (embedded electronic), we write for each SW release about 20 testplans in TestExec (which would be 20 sequences with Teststand). Each testplan use the same 2 symbol tables (where are defined about 100 variables definition and constants). From product to product and from SW release to SW release, there is always new/changed/deleted variables and constants. The name of the symbol table is always the same, only the contents is changing. TestExec reads this symbol tables at load-time of a test plan, so that you don't have to define the variables and constants separately and you can directly use them. Usually this variables and constants are related to voltages, currents, PWM duty cycle and so on....

Now we are trying to do almost the same thing with Teststand. We create 2 CSV-files which contains our variables and constants and we whant to link them in all the 20 sequences. We tried to use the property loader, but you need to define in each of the sequence files all the variables and constants, which is a bit unconfortable. Please see the attached file for a more graphical explanation.

What is the best was in Teststand to do something like with TestExec?

Regards,
Risotto

 

0 Kudos
Message 3 of 4
(3,704 Views)
Was the csv loader a feature of the old TestExec?  Perhaps it was a module someone at your company implemented?  Either way, as an alternative to using the property loader, it should be an easy project to write a small module that reads your existing CSV files and dynamically creates TestStand global variables.  You can create variables by calling PropertyObject.NewSubProperty or by calling PropertyObject.SetVal<Boolean/String/Number/Reference> with the PropOptions_InsertIfMissing flag. You can get the station globals PropertyObject from Engine.Globals.
 
To reduce clutter and to make old variables easy to delete when you read in a new csv file, you might want to create them all under a PropertyObject container variable, perhaps named something like StationGlobals.Symbols or StationGlobals.TestParameters.
 
I've attached a short sequence that shows how to do this..
 
 
 
 
 
0 Kudos
Message 4 of 4
(3,699 Views)