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: 

Is there a way to reset displayed Step Status for successive loop iterations (NI Sequence Editor with Tracing enabled)

Solved!
Go to solution

I'm running a sequence under the Sequence Editor (single pass) with tracing enabled.  I find that when I enter a looping section of my sequence, the displayed Step Status starts out blank, gets set on the first pass through each step in the loop, and the steps remain displayed at that status unless/until changed in a later loop.  I'd prefer that the step status' reset to blank at the beginning of each loop iteration and then get set/displayed when the step is (again) completed in order to better show the progress through the loop(s).  Is there a way to accomplish this?

0 Kudos
Message 1 of 10
(5,013 Views)

In your loop insert the following statement expression immediately after loop statement:

 

RunState.Sequence.Main["Step Name"].Result.Status == ""

 

Where "Step Name" is the actual name of the step whose status you want to blank out. Also note that "Step Name" in my example exists in Main sequence. You may replace this with actual step location (Either Main sequence or any sub sequence).

0 Kudos
Message 2 of 10
(5,003 Views)

Thanks.  I tried your suggestion, but it doesn't quite accomplish the objective.  Adding the statement expression

RunState.Sequence.Main["Step Name"].Result.Status = "" does clear the status string (I can see this happen in the Watch window), but the prior results do not actually clear unless/until there's a break in the sequence execution - at which point it clears exactly as desired.  So I guess we're halfway there, but I still need to somehow push the change out to the display while the sequence is actually running.  I took a look in the process model, but nothing jumped out at me as driving the display updating. 

 

This really just an annoyance at this point, and I can probably work around it by moving the steps into their own subsequence and calling that from inside the loop, but I was hoping for something a touch simpler.

0 Kudos
Message 3 of 10
(4,987 Views)

Yes, you are right. Even I observed the same at my end. After the statement expression step if there is a breakpoint inserted the UI updates the test status.

 

I guess this looks like a bug in TestStand. Can some NI engineer confirm on this issue?

 

Is there any TestStand patch available or is there any other method to achieve this?

0 Kudos
Message 4 of 10
(4,975 Views)

Your Probably need to do a Refresh such as ExecutionViewMgr.Refresh ( [seqCtxt])

 

Regards
Ray Farmer
0 Kudos
Message 5 of 10
(4,971 Views)

I'm unable to see this "execution view manager" anywhere in TestStand API call. Can you attach an example?

 

My approach:

 

Automation Server: NI TestStand 2010 API (Ver 1.0)

Object Reference: ThisContext

Object Class: Sequence Context

Call Method : ??? I dont find Refresh here

0 Kudos
Message 6 of 10
(4,969 Views)

Sorry that's for the UI,

 

Try PostUIMessage Method either Engine or Thread and send a UIMsg_RefreshWindows message

 

Regards
Ray Farmer
Message 7 of 10
(4,896 Views)
Solution
Accepted by topic author 04RC51

Thanks Ray !

 

I've attached an example using the method suggested by Ray for reference.

Message 8 of 10
(4,894 Views)

Yup, that gets us there.  The combination of clearing the step result strings and then posting the UIMsg_RefreshWindows message gets the job done, though it's a bit laborious to implement if the loop contains a large number of steps - and I never would've found that API call on my own.  Thanks to you both. 

 

In the end, I think clearing the displayed step results for steps within a loop at the beginning of each successive loop iteration should be the default behavior.  I think it's a slight bug the way if functions right now, and the change would make for an improvement to the Sequence Editor (tracing) UI.

Message 9 of 10
(4,885 Views)

I second this opinion!

 

It is also too much work (and error prone) to add every step to the clearing statement

 

 

0 Kudos
Message 10 of 10
(4,387 Views)