NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access MainSequence variables from a VI in subsequence

I have a VI inside a subsequence, which needs to get a loop count parameter from the MainSequence as well as the name of the subsequence in which the VI is placed. Currently, "ThisContext" is passed to the VI but it only offers access to Locals (subsequence) variables. Is there any way to have full access to MainSequence variables as if the VI was placed in that level?

 

Thank you.

0 Kudos
Message 1 of 7
(3,845 Views)

You can access the Context of MainSequence by putting down a property node and choosing Caller.  Then you can access the Locals of that.

 

Let me know if that makes sense or if you need more info.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 7
(3,835 Views)

Thanks! I was able to get the loop count parameter from the MainSequence.

 

Now how can I get the name of the subsequence where the VI is one of the steps? I looked through variables of the subsequence (with pause) but I couldn't find one that contains the subsequence name.

0 Kudos
Message 3 of 7
(3,798 Views)

you should be able to use the SequenceContext and use a property node to ge the Sequence.  Then use that reference to a property node and get the name.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 7
(3,764 Views)

I chose the CallStackName property under SequenceContext and then had to remove "- Cleanup (blah blah.seq)" from the resulting string since the VI is placed inside Cleanup of the sequence. This is the only way I could find after looking through the list of properties.

0 Kudos
Message 5 of 7
(3,762 Views)

Check out the attached image.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 6 of 7
(3,760 Views)

That is neat!

0 Kudos
Message 7 of 7
(3,752 Views)