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: 

Multiple (floating) front panel application in labview

Solved!
Go to solution

I am trying to build a multi-window application. My goal is to be able to have multiple floating windows open simultaneously, which all allow user input. 

 

My problem is, when I open a new floating window, I can no longer click buttons in the other windows.

 

I've attached a simple example of what I'm trying to do. The Main.vi has two parallel loops and two event structures. One loop has the sole purpose of running the Sub.vi after a button is clicked. The other loop performs some functions when the other buttons are clicked. Since these loops run in parallel, I would think that I can interact with both VI's when the front panels are open.

 

What am I missing here?

 

Any help is appreciated. Thanks. 

0 Kudos
Message 1 of 7
(4,267 Views)
--
0 Kudos
Message 2 of 7
(4,243 Views)

Your bottom loop stops because you have a regular call to the subVI.

The event loop cannot finish until the subVI finishes.

 

To strictly answer your question, Take a look at the options for the EVENT structure.  By default the LOCK OUT KEYBOARD UNTIL THIS EVENT IS FINISHED is set ON.

That means just what it says.  When you call that subVI, the event locks out the keyboard/mouse on the calling (MAIN) VI.

 

Having TWO event structures in one VI is asking for trouble.

 

 

I have an app with 10-12 windows, all of which are overlappable, and usable.

 

the way you do it is to run all 10 VIs at startup, but keep them closed.

 

Send each one an EVENT from the main VI when you want it to open.  All they do in response to that event is FP.OPEN.

 

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 7
(4,236 Views)

 My goal is to be able to have multiple floating windows open

 

Why do they need to be floating? Do you need to hide them when your app goes background?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 7
(4,219 Views)
Solution
Accepted by aweiss47

There is an option in every event case that is set to TRUE by default: Defer Front Panel Updates Until Event Case Completes.  What does this mean?  When you click the button to open the subVI, that event case cannot complete until that VI is done running.  Since the event case is not complete, your main front panel is actually locked (unable to do the updates).

 

In general, you really should only have 1 event structure in a VI.  What you should do here is use the Start Asynchronous Call to run an instance of your subVI without disrupting your main VI's flow (it will truely run parallel to the rest of your code).

 

And you really should put the latched buttons in the event case that handles their respective value change event.  It will allow the latch back to happen.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 7
(4,217 Views)

Thank you for the replies. I figured there was a setting somewhere that I overlooked.

 

I only used two event structures as an example to try and force the desired behavior.

 

And in response to your asking why I said "multiple floating windows", what I meant was non-modal. 

0 Kudos
Message 6 of 7
(4,175 Views)

Maybe you should try using Actor Framework to achieve multiple floating windows in your application? Actor Framework enables you to treat each window as separate object, with references for main application to operate on windows. It makes creating multi-windowed application in LabVIEW more similar to creating such application in languages like c, c#, c++ etc.

 

https://decibel.ni.com/content/blogs/Labvolution/2014/07/23/labview-actor-framework-basics

0 Kudos
Message 7 of 7
(4,092 Views)