Hello Tim,
The TestStand handle you would use for the TS_PropertySetVal wrapper functions is a SequenceContext object, which only exists at runtime. If your code was being called by a TestStand step, you could have the current SequenceContext (ThisContext) passed to your code as an object reference.
However, from looking at your posting, it looks like you're doing something entirely different. I believe you're attempting to programmatically do the following with TestStand 3.0 (please let me know if my understanding is incorrect):
1) Load a sequence file.
2) Change the default values for TestStand variable(s) contained in the sequence file.
3) Execute the sequence file using the new values for the TestStand variables.
Based on t
his, there are several approaches you can consider:
1) Load the sequence file, modify the TestStand variables default values, save the modified sequence file to disk, then execute the sequence file. This approach would require that you have a TestStand development license on each machine that executes this code, since any software that creates or modifies TestStand sequence files is acting as a development system.
2) Alter your TestStand sequence file to use a Property Loader step, so it can modify the variable(s) values based on the contents of a properties file. You can programmatically create this properties file on-the-fly in CVI, so that when the sequence is executed it loads the values you have saved into the properties file.
3) If you're just executing your sequence file without using a process model, you can use the TS_EngineNewExecution method's sequenceArgsParam and pass PropertyObjects as parameters to your TestStand sequence.
I'd recommend approach number 2,
it's by far the easiest to implement. There are other approaches to doing this as well, but these are the first ones that come to my mind.
David Mc.
NI Applications Engineer