NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Locals variable that remains after run completed (LabVIEW)

I am trying to create a Locals variable that remains after a sequence run is completed.  When I use the PropertyObject to create a Locals variable, its scope is available only when the sequence is running.
 
Respectfully,
Robert
0 Kudos
Message 1 of 8
(4,027 Views)

The locals you see at runtime are a copy of the default locals in the file. Each instance of a running sequence needs its own copy of the locals because their values can vary in different running instances of the same sequence.

The edit time definition of the sequence local variables has a property path such as:

RunState.SequenceFile.Data.Seq["MainSequence"].Locals

If you modify these locals and you want the file to be marked as modified so that the user is prompted to save, then you should also call:

RunState.SequenceFile.AsPropertyObjectFile().IncChangeCount()

Note that changing the edit time locals only affects new executions. You might need to modify both the edit time and runtime locals depending on what you are trying to accomplish.

0 Kudos
Message 2 of 8
(4,020 Views)

James,

I tried this in my code and it did not work for me.  Could you provide me with a LabView example?

Thank you,

Robert

0 Kudos
Message 3 of 8
(4,015 Views)
I'm not much of a LabVIEW programmer, but if you can post a simple vi/sequence that shows what you are trying to do, I'll try to fix it (I have LV 7.1).
0 Kudos
Message 4 of 8
(4,001 Views)
This vi addes a variable to the TestStand sequence during runtime whose scope only exists during runtime.  I am trying to figure out how to BOTH use it at runtime, and have it persist when the sequence has completed.
 
Respectfully,
Robert
0 Kudos
Message 5 of 8
(3,996 Views)
Here it is. My sloppy wiring makes it look more complicated than it really is.
0 Kudos
Message 6 of 8
(3,993 Views)

Thank you very much.  This works very well.

Respectfully,

Robert

0 Kudos
Message 8 of 8
(3,983 Views)