NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a Teststand status bar

I am trying to understand how to update a progress bar that I want to add to the Teststand simple interface. I have been through the one example that ships with TS that shows some info on doing the job through a vi, and after a bunch of searching I have found a number of other items that seem related to this job.

 

Ideally I would like to build something generic (and simple) that will just show where I am in the execution of the top level main execution, maybe a percentage based on the current step index/total # of steps times 100 to get a percentage value.

 

Here are the items that seem like they might be related:

 

Under the UI messaging category there is a code called UIMsg_ProgressPercent.

 

Under the Execution View manager there is a NumericSource_ProgressPercent.

 

I can understand the UIMsg_ProgressPercent, but I can't see why it is any different than just sending a numeric value with any user configured event. Is there some inherent link to an ActiveX control on the UI?  I can place a Status Bar activeX manager control, but can't see how the link occurs. It seems like it is possible to place several status bars, so how do I link to specific one? 

 

As for the NumericSource_ProgressPercent, what is this thing returning exactly?

 

Any assistance would be appreciated. Thanks!

0 Kudos
Message 1 of 4
(4,816 Views)

Hi.

 

You have to configure the 'panes' of the UI StatusBar Control.  Here is what I do to implement a StatusBar.

 

1.) Right click on the UI StatuBar control and select StatusBar->Properties...  From this window you can name all the panes that comprise the statusbar.  I will later use the 'index' of a pane to update them as needed.

 

2.) From the AfterUIMessageEvent Callback, I configure Event 11 to handle the progress percent update.    I have some code in my process model that updates the progress percent ( sends a UI Message ) with a new value based on the # of steps completed in the mainsequence in comparison to the total number of steps.  See attachment for the code.

 

I hope this gets you started.  Good luck.

 

PH

 

 

 

0 Kudos
Message 2 of 4
(4,811 Views)

Thanks PH! I think this will get me on the right track.

0 Kudos
Message 3 of 4
(4,789 Views)

Hi,

 

I have a similar problem now, and your code works fine. But the indication of the progress should work even without this.

 

The ExecutionViewMgr.ConnectCaption should do the same, if I associate the CaptionSource_ProgressPercent with the right pane of the status bar. It works with the delivered fully featured UI for TS2010 SP1.

 

I modified it a little bit, and I expect an update on the corresponding status bar pane upon calling the Thread.PostUIMessageEx. But it won't be updated, so what else do I have to do additionally to call the ExecutionViewMgr.ConnectCaption ?

 

MB 

0 Kudos
Message 4 of 4
(4,327 Views)