NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do send TS data (local variable value) back to the GUI?

I have modified a Pre-UUT callback to allow a user to select a model for a UUT.

This is done through a seperate vi that pops up and then closes once the operator hits a continue button. Now I save the model number in a local variable and would like to see that model number displayed back on the GUI when I start running in the deployment mode, i.e. the standard simple interface that TS comes with. I can easily add an indicator there, but how do I read the value of the TS variable and update the panel?  I figure I need to use the TS Get property in the interface, but I am not sure how to get the context reference for the sequence that is being run. I took a stab at putting this in the Timeout case of the standard GUI interface because I assumed it executed almost constantly, but maybe that approach doesn't cut the mustard either.

 

I am attaching a few screen shots that I hope will clarify what I want to do, namely updating the "Model Being Built" indicator. While the front panel of the GUI is modified slightly (color, extra indicators) the background code is pretty much the standard shipping code from TS. There are more notes in the attached file.

 

 

0 Kudos
Message 1 of 3
(3,253 Views)

You can use TS Get Property, You just need the sequence context, an easy way is to send the sequence context using UI Message.

 

You can browse the forum looking for examples.

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 2 of 3
(3,252 Views)

The issue you are running into here is that the event structure by default does not have a timeout, so it never actually runs code in that case.  You have a couple options to update the control:

 

  1. add a timeout value (in milliseconds).  this will cause the event timeout code to run if no events happen in the specified amount of time.  This method is not efficient, since you would be constantly polling the local, and it requires hard coding properties into the UI code, which is not a good idea (if the UI is used on a sequence without this local variable, you will get errors)
  2. A better implementation would be to use a UI message as Roderic mentioned.  A good tutorial descrbing the process of posting and handling these messages is here:

    Using Default and Custom UI Messages: http://zone.ni.com/devzone/cda/tut/p/id/4532

    Using this method, you could simply pass the model number through a UI message, then update the interface with the value. 
Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 3 of 3
(3,239 Views)