I am trying to read the teststand variable(local/fileglobal) value in my LabVIEW VI.
Howerver when I am trying to run the VI I am facing an error saying "Error -17306 occurred at Unknown variable or property name 'Locals'."
I have attached my VI here for reference.
Any help is appreciated.
Solved! Go to Solution.
Are you trying to get the variable while the sequence is executing, or just pull the default value for the variable?
Sequence Context is only used for current executions. The code you attached never actually executes a test sequence, so you don't have a valid Sequence Context to reference. The NewEditContext Method you are using creates an approximation of what the actual runtime Sequence Context would be. This is also a context of the SequenceFile propertyobject rather than the Sequence propertyobject where the Locals variables container exist. (Sequence is a subproperty of SequenceFile)
If you are just looking to get the default value of the variable (as it is stored on disk), then the TestStand - Get Property Value function will not work for you (as it requires a valid Sequence Context). You can instead use the TestStand API to acquire a reference to the Sequence and then the Locals variable container, and finally the variable itself. Here's an example:
FileGlobals are stored as subproperties of the SequenceFile propertyobject, so you don't need a reference to the Sequence to get them. Here's an example:
I am trying to read the value of the executing sequence.
The seuqence starts its execution by the seperate VI . This VI is called once the teststand sequence starts executing.
I am able to read the value of variable of TestStand which is of String type.
However when I am trying to read the value of Boolean type variable , its not giving me the current value.
Its always give me the default value.
I have TS_OPInterface.vi wherein I am launching the TS and getting the reference of the Seq file which I want to execute.
This Seq file ref is then passed as an input to Read_TSParam.vi wherein I am trying to read the fileglobals values of TestStand in LabVIEW.
However I am able to get only the default values of these varaibles and not the run time values.
I have attached both VIs here for reference.
How can I ensure that the sequence file reference which I am passing is a valid one?
It's difficuilt to tell whether your sequencefile is running or not and where Read_TSParam.vi fits into the overall picture because it doesn't seem to be called directly from TS_OPInterface.vi. Maybe its called in Custom - Open Sequence Files.vi.
If all you have done is load the sequence file then you will not see the runtime version of the Fileglobals yet this is only available during the execution of the sequence. Also you should be using Property FileGlobalsDefaultValues.
Are you trying to write the Serial Number to a Custom UI?
If so why don't you use the UIMessage to post the value and have an Event callback pick up the value to write to your indicator.
Thanks for all your replies. 🙂
As suggested by Ray , I am using custom UI messages now to communicate data between LV and TS.