From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I hold ThisContext from a step and use it in a later step to find the current step name? Error 1 when retrieving step name.

Solved!
Go to solution

I am trying to create a generic message logger class using LVOOP.  The logger would include information about the step at runtime (name, sequence, etc.).  I would like to create the message logger Object and then pass it into another Object (communication, oven controller, etc.).  Each would get its own copy.  None of this is an issue so far.  

 

I have found ways to gather the information needed by passing in ThisContext.  However, this only appears to work if ThisContext is passed in on the currently executing step.  If I hold ThisContext in LVOOP, the next step to try to use it creates an error 1 "An input parameter is invalid".  Is there a way to get this type of information (name, sequence, etc.) without passing in ThisContext in at every step?  It would be inconvenient to do this, but if necessary I will.  It does go against LVOOP.

 

Summary:  Can I hold ThisContext from a step and use it in a later step to find the current step name?  If not, is there an efficient way to do this?

0 Kudos
Message 1 of 2
(4,191 Views)
Solution
Accepted by topic author PrismGreg

My solution was to store the thread reference.  At any step, I can retrieve the current context.  This is only valid within a thread, but meets my needs.  I could also pass something at a higher level, but that would require knowing which thread I am interested in anyways.

0 Kudos
Message 2 of 2
(4,014 Views)