NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the output values after each step executes in LabVIEW User Interface

Solved!
Go to solution

Hello all,

 

Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1

Problem: is there a way to execute the subsequent steps programatically and get the output values from each of them?

 

I have already extended a little bit a Full OI interface for TestStand to load up any sequence, choose some of the steps and run them step by step (something like option to Run Selected steps). What I am trying to do is to add some actions between each step and do that in User Interface (I can't modify the sequence!), so I am starting the NewExecution with some previously configured InteractiveArgsParam and set an option breakAtFirstStep to True. Afterwards I am just doing something like Step Over when debugging the sequence and this works good, but I didn't fine a way yet to read the output values from the steps...

 

Then, if I wait until the execution finishes I can read my Results by processing the ResultObject, but this works only after finalizing of the test sequence. Since I wanted to stop after each step, read the values, do some actions and continue to the next step I tried to register an event callback for Trace of Execution View Manager. I can see that after each executed step this event is triggered, but when I try to read a ResultObject returned in Event Data it is not filled with values (ResultList seems to be empty?). Is it a proper behaviour or maybe I am doing the readout in wrong way? (It is the same VI as for reading ResultObjects after sequence finishes and there it works fine for arrays, containers and other data types).

 

Like I mentioned I can't modify the Test sequences, I can't add a UImessages.

 

What are my options? Should the trace event returns all output values from each steps or is it just used for status checking? Or maybe there is completely different approach to that matter?

 

Thanks in advance for any suggestions,

Best Regards.

 

 

------------------------------------------
CLA, CTD, CLED @ Test & Measurements Solutions Poland
0 Kudos
Message 1 of 9
(4,420 Views)

Hi Folon,

 

For the similar type of environment, rather than UI messages I am using network queues to post messages from Teststand to my LabVIEW GUI. My sequences has all steps of LabVIEW module which does the posting and GUI after receiving message can appropriately take some active.

 

Hope this helps,

Regards,

Vidula

 

0 Kudos
Message 2 of 9
(4,417 Views)

Hello Vidula S.

 

The problem is that it has to work with any test sequence without any additional programming in them. I just have to load up any given sequence and my User Interface application must be able to go through it step by step and read the values from each step before starting the next one.

 

Are there any other solutions that can apply to that matter?

 

Best Regards,

------------------------------------------
CLA, CTD, CLED @ Test & Measurements Solutions Poland
0 Kudos
Message 3 of 9
(4,404 Views)
Solution
Accepted by topic author folon

When handling the trace UIMessage (you need to to all of this before returning from the event or you will introduce race conditions), get myuimessage.Thread. Then call Thread.GetSequenceContext(0, &notused).

 

Then on the sequence context, either access PreviousStep.Result if it exists, or look at Locals.ResultList.

 

Trace events happen between steps so the step that executed most recently is the previous step, but there is also a trace event at the very beginning before any steps have run at which time there won't be a previous step.

 

Hope this helps,

-Doug

Message 4 of 9
(4,394 Views)

dug9000,

 

That is my solution, good tip, thanks a lot.

 

Below is a screendump of the Trace event Callback VI - it reads everything from the LastStepResult (recursively for arrays and containters) and stores them in the functional global.

 

Trace Event Callback

 

Best Regards,

Folon

------------------------------------------
CLA, CTD, CLED @ Test & Measurements Solutions Poland
0 Kudos
Message 5 of 9
(4,381 Views)

HI,

I want to also read the result after each step, and show them to the user.

I have tried to building a some model as folon's solution, it works till the "LastStepResult", and my question is, how can I show it to the user?

 

Cabio

0 Kudos
Message 6 of 9
(4,335 Views)

Hello Cabio,

 

This is not so easy as it might appear, since some of the objects inside of the ResultList are a 'complex' ones (like arrays, clusters/containers, arrays of containers...).

 

Basically you start from LastStepResult, then by use of method GetNumSubProperties you know how many entries you should read (do it in For loop). Inside of the loop you use GetNthSubProperty method and wire the loop index to it (options = 0; lookupString = empty), with that reference you get property Type (wire it to ValueType property afterwards) and Name. This is your first entry read from the results. If this is String, Boolean, Number, you just read it by GetValString or GetValBoolean property. If this is a 'complex' type you need to do that recursively.

 

Good luck:)

------------------------------------------
CLA, CTD, CLED @ Test & Measurements Solutions Poland
0 Kudos
Message 7 of 9
(4,332 Views)

Thanks for your replay, I have tried to build it in my LabView Block Diagramm, es seems like this image.

But the variable GetNumSubProperties ist always 0. Why?

 

PS: I need only the variable "Step.Result.PassFail" from the last step, do you know, how can I get it? I think, it is maybe easier than read all the "Result". Smiley Wink

0 Kudos
Message 8 of 9
(4,328 Views)

Cabio,

 

Is tracing enabled in your TestStand? Station Options -> Execution -> Enable Tracing?

 

Best Regards.

------------------------------------------
CLA, CTD, CLED @ Test & Measurements Solutions Poland
0 Kudos
Message 9 of 9
(4,321 Views)