NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update a sequence file global variable using property loader

How to update a sequence file global variable using property loader
 
0 Kudos
Message 1 of 4
(5,395 Views)
You can use the Property Loader step in TestStand. Here you can either specify the file you want to load the variables from or you can specify a database field you want to load properties from. Alternatively, you can use Tools>>Import/Export Properties if you do not want to load the variables dynamically. Thank you Nandini S. NI
0 Kudos
Message 2 of 4
(5,372 Views)

If this is your first time working with the Property Loader I recommend the following steps:

- Save the Sequence File and go to Tools-> Import/Export Properties…

- Set the Data Location to be a File (You can change it later if you need to use a Database).

- Enter the file path.

- Select a File Format.

- Go to the Properties Tab and from the Available properties list (tree) select your global variable. The global variable should appear in the selected properties list.

- Click the Export Button.

- If you go back to the Source Destination File and click on View File you will notice that the file you selected was generated and that it has a special format.

 

You will identify the name of your variable under <File Globals> and the variable value under ‘Variable Value’.

 

Change the variable value to whatever value you want and save the file.

- Now, if you click the Import Button, the tool will get the value from the source file and set the edit-time copy of the sequence global variable to the value you entered in the file.

- Click the Done button and go and check the value of the sequence global variable. The value should be the value you entered in the file.

Message 3 of 4
(5,367 Views)

To load the property dynamically you can use the Property Loader Step.

 

- Insert a Property Loader Step in your sequence (Usually you insert the step in the Setup group in order to load the property before you run your main sequence. You can insert the step wherever you want though)

- Edit the property Loader Step (Ctrl+E).

- Set the Data Location to be File and select your sequence file global variable from the available properties list.

- Go to the Source Tab and Select the specific file you created with the tool (Import/Export Properties…).

- Now every time the step is executed the property will be loaded from the source file.

- Open your source file with notepad or any other text editor and edit the value of the property.

- Now Insert a Breakpoint before and after your property loader step is executed and check the value of the sequence file global property.

- You should see that the value of the property changes after the step is executed.

- Now all you have to do is to modify your source file every time you want to assign a different value to the global variable.

 

I recommend you to check the TestStand Online Help and the  Examples under <TestStand>\Examples\PropertyLaoder\

0 Kudos
Message 4 of 4
(5,366 Views)