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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Run VI" in subpanel grabs focus

Hello,

I have an application that runs one of many VI's in a sub-panel on a main GUI screen. The main GUI has several string controls that can be typed into at any time, and the keyboard focus is taken away whenever "Run VI" is called on a vi in the sub-panel.

Attached are a couple of vi's demonstrating my problem. run "top.vi" and notice how typing into the string controls is interrupted when the sub-panel reloads. [Preview doesn't show the focus.zip file that I entered into Attachment, so I don't know if this will work....]

Any clues or help? thanks.
0 Kudos
Message 1 of 8
(3,340 Views)
Hi Mike

Try to start the subpanel-vi just once, but keep it running by itself (so it should contain a while-loop).
I attach you the modified programm. Just have a look at it.

Hope it helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 8
(3,324 Views)
Thanks.... but in the actual application I am launching one of many VI's in the sub-panel, and I doubt it would be a good idea to keep all of them running in the background at the same time. Any other explanation for what is going on here?
0 Kudos
Message 3 of 8
(3,314 Views)
Mike,

This behavior can be avoided by passing control references to the SubVI. With a control reference it is possible to set the key focus back to the appropriate control on your main panel.

The attached VIs demonstrate this. While there will be some small amount of time where the control no longer has focus, I was able to type in many long strings without ever having my text interrupted.

Scott Y
NI
0 Kudos
Message 4 of 8
(3,295 Views)
Can you post that in LV 7.0 please?
0 Kudos
Message 5 of 8
(3,290 Views)
Saved for 7.0

Scott Y
NI
0 Kudos
Message 6 of 8
(3,286 Views)
Thanks for your response, Scott. That seems like a possible workaround. The problem with that technique is:

* the actual application has several independent sub-panels,
any one of which might be involved with an entry from the user.
It would be very klumsy to notify them all of each other's UI
controls so that focus can be preserved.

* barcode scanners are used which type much faster than I can,
so the momentary loss of focus, before the subvi puts it back,
will cause loss of characters.

Apparently there isn't a real solution to this problem?! I was hoping that there were properties of a VI that would affect this behavior, but I have been experimenting all day with no success.
0 Kudos
Message 7 of 8
(3,282 Views)
Hi Mike

Passing a value to all subpanel-vis is also possible by creating a control in these vis, from which you get a reference first. Using this reference you can access it and pass a value.

Just have a look at the attachment.

Hope it helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,274 Views)