From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Hidden execution, but visible on the statusbar

Hi All.

I have a background seq, that is handling various things, for instance barcode handling.
This seq is started from my OI with "NewExecution", no process model, and ExecutionTypeMaskParm is set to 0x01 (hidden).
The problem is that in this seq am I writing to the statusbar on my OI, but it seems that you can't write to the StatusBar when the seq is hidden, as soon as I change to ExecutionTypeMaskParm 0x00 (visible), then there is no problems.

To post a text to the statusbar am I using PostUIMessageEx eventcode:UIMsg_ProgressText

What can I do about this, a quick work around is to unhide the execution, this will also work for now, but I need to hide it for the operator.

Kind regards Thomas
0 Kudos
Message 1 of 9
(3,651 Views)
Hi,

Hidden execution run in the background, where as the OI runs in the foreground.

Therefore, you will have to get a handle to the foreground thread by making a call to first;
id_index = Execution.ForegroundThreadIndex().

This will return an index which you use in the next call to get your thread; call Execution.GetThread(id_index). This will return the thread reference which you use the Thread.PostUIMessage() or PostUIMessageEx().

Hope this helps
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 9
(3,644 Views)
Hi Ray

I have tried what you suggested, but it dosn't seems to change anything..... so I am properly doing something wrong

Just to clear it out.
Getting the index as.

Object reference : Runstate.Execution
Object class Execution
Then get property ForegroundThreadindex
(saving index to Locals.ThreadIndex)

Then the next step
Object reference : Runstate.Execution
Object class Execution
Then get property GetThread
(saving thread to Locals.ForThread)

Next step.
Object reference : Locals.ForThread
Object class Thread
Cal method PostUIMessageEx "0"

All this is executed in my background seq

I have tried to read the index and it is always "0"

Another thing I doen't understand is that in the next step I am posting another UIMessage (event code UserMessage) to read a control from my OI (barcode), this is working without any problems, so actual I could write to a control on the OI, but not to the StatusBar... (just for your information)

Kind Regards Thomas
0 Kudos
Message 3 of 9
(3,619 Views)

Hi All.

Is there anybody else that have a comments to my problem ????

0 Kudos
Message 4 of 9
(3,591 Views)
Thomas
Thead.PostUIMessageEx post messages to the OI. The UIMsgProgressText message is handled automatically.  If the execution is visible, the OI displays the message in the status bar.  If no execution is visible, the message is discarded.
 
You have a few options.  You can try to capture the UI message and display it elsewhere.  For example, if you are using an OI that has a ApplicationMgr control, you can use ControlName_AfterUIMessageEvent. Otherwise you can just create your own user message for a custom progress text message and display this on your OI in your own way.
 
Scott Richardson
0 Kudos
Message 5 of 9
(3,558 Views)

Hi,

been on holiday for a while, did you sort your problem out?

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 9
(3,533 Views)

Hi Ray....

 

Now I am also back from holiday..

 

No I haven’t sorted out my problem, and to be honest, then I don’t want to do it as Scott is proposing, this should be a workaround if your way is not working.

 

So if you have any comments to my second post, then I would appreciate that.. I just tried again... and it still seems that my hided execution cant get an index to a foregroundthread...  a remark... and this point where I want to write to the OI, then there are no unhidden execution running.. only the hided background seq is running, where it waits for a new board.

 

Regards Thomas

0 Kudos
Message 7 of 9
(3,515 Views)
Hi Ray.......
 
Would you please make a comment on my last post..... this is still a major problem for me....
 
Thanks in advance
 
/Thomas
0 Kudos
Message 8 of 9
(3,466 Views)

Hi Thomas,

I'll revisit whats been said and see if a solution can be found....

Regards

Ray Farmer 

Regards
Ray Farmer
0 Kudos
Message 9 of 9
(3,463 Views)