NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a new vaiable to the file loaded by Property Loader without changing my script

I have an input file to my script that I load via Property Loader. The number of parameters in the input file may change from test to test.. Is it possible in some way to add a new parameter without changing the sequence file?
 
Is there for example a way to make the Property loader read parameters until end of file, and put the parameter into a temporary variable in my script?
 
Hope there is a way to resolve this.
 
Cheers
Claus Christophersen
 
0 Kudos
Message 1 of 7
(4,069 Views)

Clausi,

What version of TestStand are you using?
In TestStand 3.1 we introduced a feature to accomplish exactly what you want.
In the properties tab of the "Edit Property Loader Dialog" you only have to check the "Import All Properties from Data Location"
check box.

Import All Properties from Data Location—Specifies to ignore the selected property list and import all properties from the file or clipboard instead. This option does not apply when importing from databases.

Hope it helps.

If you have any problems let me know.

Antonio Lie. 

0 Kudos
Message 2 of 7
(4,062 Views)
Hi Antonio
 
Thank you for your respons.. 
I use TestStand version 3.1 and I see that there is an option for importing all properties from the data location.
 
However, this still requires me, on beforehand, to know the name of of the addad parameter to be able to handle it in the seq. file ?
Or if I add a new parameter to the data file... will it then automatically get the same name in the seq file.. ?
 
I don't know the name of a parameter to be added to the data file.. I only know how to handle it in the sequence file.
 
Regards
Claus
0 Kudos
Message 3 of 7
(4,052 Views)

Clausi,

You need to add a valid property to your source file otherwise it would not be imported.
If you try to import an inexistent property you would get a run-time error indicating that the property does not exist.
Could you explain me what are you trying to do?
If you do not know the property name (location) how are you going to use it at run-time?
Are you going to create this property dynamically?

Best Regards.

0 Kudos
Message 4 of 7
(4,044 Views)

Hi Antonio,

Basically what I want to do is to import a parameter and it's assigned value (like "ethernetSpeed '2' ") declared in my input file.. I want to send this parameter and value to some hardware. 

But depending on the type of test I want to run, this parameter could be something else.. but it should still be send to the same piece of hardware.

So, it could be cool if the parameter declared in the input file was automatically created in the .seq file.

The solution I have come up with is: I create an array "TestParam" and also create this in my .seq file. In this string array I put "ethernetSpeed 2". In my script I can then read the value.. even if it's changed.

I guess I can make it work this way

 

Thanks

Claus

0 Kudos
Message 5 of 7
(4,026 Views)

Claus,

The solution you have is a valid one.
Basically you have a variable (global or local) and you import the expected parameter to this variable before you pass it to the hardware.
You use that variable as the input parameter you pass to your hardware of course.
You have to modify your source file depending on the test type you want to execute every time you want to change the test type though.

Another solution would be to use Data Markers in your file to separate the variable values corresponding to each test type.

Check the example I am attaching.
At the beginning I prompt the user for the Test Type (Type I or Type II).
Based on the type, I import the corresponding variables from the source file using Data Markers.

If you have questions let me know.

 

0 Kudos
Message 6 of 7
(4,009 Views)
Antonio,
 
Thanks for your feedback..
 
I will try to go with my own solution, and keep your input in mind..
 
Regards
Claus
0 Kudos
Message 7 of 7
(3,988 Views)