NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep a "front panel" open during another sequence?

Hello everybody,

 

I'm new on the TestStand forum and I have a question for my project.

 

I need to make a test sequence with several sub-steps: Barcode reading, Data reading, Data analysis etc... and all these steps in a "For" or "Do... while" loop under TestStand.

Before doing the loop, I want to create a "global HMI" step using labview, with on the front panel, the status of each sub-steps. I need to update the status of each sub-step after their execution. 

 

The sequence TS is:

 

Step Action Labview: HMI.vi (display front panel when calling vi)

Loop for

{

Barcode reading

Data reading

Data analysis...

}

 

That's why I need to keep the front panel of "HMI.vi" always open to updated /display the status of each sub-step. (something like colors of a LED). I doner 't want to call the HMI.vi after each sub-step.

I understood it's a multi-threading process and the reference of HMI.vi should always be active during all the "for loop", but I don't how to keepthe reference.

 

Could you please kindly show me how to do it under TestStand (verstion 4.1) with LV (7.1).

 

Many thanks in advance, 

 

0 Kudos
Message 1 of 4
(3,401 Views)
Hi zuzu,

I believe the following example program does what you are looking for. You will have to modify it for your purpose of course:
Developer Zone Tutorial: Launching a Floating LabVIEW Panel in TestStand

Hope this helps!!
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 2 of 4
(3,392 Views)

Hello Jervin,

 

Thanks a lot for your time.

 

I tried the solution with:

 

Call Subsequence HMI with HMI.vi 

While

{

Update HMI

My sub-steps

Simulate (time interval 0,015s)

}

End of sequence.

 

However, I don't really understand the expression "RunState.Thread.PostUIMessageEx (10200, Locals.Progress, "TestProcedure", Nothing, False)

Could anybody tell me what it means?

And how I could update more than one value on my HMI (for the status of each sub-step)? They should be "global variables", right?

 

Many thanks again for your help!

0 Kudos
Message 3 of 4
(3,373 Views)
Hi zuzu,

A UIMessage is typically used as a method to alert and pass information from your sequence or code modules to the User Interface. 
For a good discussion on this, refer to the section titled "Communication from the Test to the User Interface" here:
Developer Zone Tutorial: Best Practices for NI TestStand User Interface Development


However, you can register a callback to listen for these UIMessages in other parts of your code besides the UI as well. That's what we are doing in this case with the floating panel.

So basically, in your "Update HMI" step, you would post a UIMessage using RunState.Thread.PostUIMessage.
This posts the UIMessage, and you can pass whatever value you want from  the "Update HMI" step to the HMI.vi.
For information on the function call, refer to:
NI TestStand Help: Thread.PostUIMessage
In this case, we are sending a UIMessage with message code 10200, along with 2 pieces of data, Locals.Progress (a numeric) and "TestProcedure" (a string).

Typically, you can pass a Number, a String, a Boolean and a Variant with each UI Message. If you need to send multiple pieces of data of the same type (your second question), then you should bundle them together into an array or cluster (container) and pass it via the ActiveX parameter.
See the following forum posts for more details:
reference a numeric array in PostUIMessageEX
HOW To pass more than one numeric data with ActiveX postUIMessage

Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 4 of 4
(3,371 Views)