NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback and UI Messages

Hello to All:

I am somewhat unfamiliar with TestStand so please be patient with me...

I am running a Test Executive in LabVIEW that is polling the UI Message
queue. In the TestStand sequence I am trying to implement a callback that
will execute after every step in the "Main Sequence" including every step in
its subsequences and all sub steps within the subsequence etc...

The TestStand sequence File is rather larger and there are several different
sequence files that are run. So I don't want to have to modify every step in
the sequence files.


What I want to do is post the following specific information.

1.) Total # of steps including all subsequence steps and steps within the
subsequences etc...

2.) Step name that was just co
mpleted

3.) Next Step name to be executed

4.) Previous or Next Step # (This being relative to the total number of
steps including all subsequence steps etc... so that I can generate a status
string that is something similar to the following "Executing Camera
Calibration, step 27 of 576"

So far I have established a SequenceFilePostStep that has an ActiveX action
step in it. Now this is where I get somewhat lost. I know somewhat how to
post a UI Message however how do I get the above listed static and dynamic
information so that I can write it in the UI Message Post?? Do I need to
add several action steps in the post message callback? Your assistance is
greatly appreciated,

Thanks, -Tom
0 Kudos
Message 1 of 2
(3,553 Views)
Hello Tom,

Unfortunately, there is no method or property that returns the total number of steps including the ones inside subsequences. However, there is an API method call "Sequence.GetNumSteps" that returns the total number of steps in the given sequence reference.

In other words, you will have to recursively check every sequence inside your main sequence and call this method. In addition, it's not going to be accurate if your sub sequences contain loops and gotos. What I mean is that the total number of steps can be eventually different from the actual number of steps executed (ex.: you can execute the same step twice in a sequence with a loop).

Another idea would be modifying the process model used by your sequences so every sequence would post me
ssages regarding their actual progress, not the overall progress.

In order to get the step name you can use the API property Step.Name(). You can get the next and previous step name using the same function, just make sure you use the correct reference for the step you want to get the name. I'm attaching an example that shows how to get the next, previous step and also the total number of steps in a given main sequence (not including the sub sequences).

Roberto Piacentini
Applications Engineer
www.ni.com/ask
Message 2 of 2
(3,553 Views)