NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence Context Functional Global

Yes, yes - I remember, that SequenceContext is different in PreUUT, MainSequence, etc. - it was just an example...

Interesting, whether the same trick can be done for FileGlobals. It's possible to get reference to them by SequenceContext - but this reference should not be chaning in time of seq. execution; b/c just data what you can access via it can be changed... 

I need to try this one also... Or, even get this reference value not via SequenceContext, but from TS via expression; and then store reference in LV FGV.

But I guess, that this will not work also...

0 Kudos
Message 11 of 13
(615 Views)

Just quick update - luckily, FileGlobals reference is working inside of FGV! It's better then nothing 😃

0 Kudos
Message 12 of 13
(613 Views)

So, finally, there is one workaround.

One can store in FGV reference to FileGlobals variables.

From TS, we store to FileGlobals variable value of ThisContext.

In FGV, we read that variable, convert to SequenceContext, and retreive currently executing step name, like this:

init FG ref.pngget step name.png

But, of course, it means, that when execution is inside of subsequence, we need to re-write value of FileGlobal variable to ThisContext of subsequence; and when we go back to main sequence, re-assign value back.

But this is solvable also! Just in SequenceFilePreStep callback of the sequence, we need to assign the following expression:

FileGlobals.Ref = RunState.Caller

where FileGlobals.Ref - is variable, where we store ThisContext reference.

Then, reference value will be updated all the time.

Time benchmark shows, that reading of variable and getting step name takes up to 2 ms - it's possible to live with it...

0 Kudos
Message 13 of 13
(610 Views)