LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How is it best to develope a multiple window (front panel) application in LabVIEW?

I have only been using LabVIEW for a couple months so keep this in mind while I ask this question.

I have been testing out multiple ways of developing a application using multiple windows and passing data between them, in LabVIEW. I am not sure how to best do this. First (See attached TestApp1.0) I used the Open VI.vi to open and close the VIs as I wanted to use them. This worked well I could have multiple windows open at once and could easily pass data to them by simply laying the VI in the main while loop. The draw back was it required polling and lots of extra logic to open and close the different VIs.

Next I used the event loop ( see TestApp2.0)and eliminat
ed the use of Open VI by simply laying the VIs into the event loop and selecting them to display front panel when called. The draw back to this was I could only have one window opened at a time, and since I had to put the SubVIs in loops I could not pass data easily from another form to it while it was running.

Finally, I have seen examples using a VI server. This looks much more complex and I am not sure if it would be worth the time figuring it out.

Does anyone have any suggestions for what the best way to design this type of application is? Am I missing something?
Download All
0 Kudos
Message 1 of 10
(4,603 Views)
Hello NIBOUND,

I looked into your "Method 1"-files. That's roughly
the way I would do this, but I changed the files a
little bit.
The subform2 (input of data) is now only called when
the user wants to input some data. I changed the
window setting to "Open when called" and "Close after
run". The other vi subform1 runs the whole time in
your main loop. Is this wanted? If not, then you can
change it to the same behaviour as subform2...

Best regards
Gerd
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(4,603 Views)
Hi NIBOUND,

Applications that require using multiple windows can be written in a variety of ways. It appears that you are on the right track.

I personally like to use a method that is similar to your "method 1" However, "method 2" can also be very useful; it really depends on personal preference and the behavior you want to see from LabVIEW. I would also recommend using the settings ("Open when called" and "Close after run") that GerdW posted.

Let me know if you have any more questions.

Have a great day,
Brooks W.
National Instruments
0 Kudos
Message 3 of 10
(4,603 Views)
Thank you so much for taking the time to make those changes to my test applications. I am really looking for two types of functionality. First the ability to just view one form at once modally. This is no problem. Next is the ability to have many forms open at once displaying different information from different VIs. This isnt a problem but forintance subform1.vi ran the whole time it seemed to slow down execution. Therefore I am worried that if I always keep the VIs I want to open at the same time running that it will bog down my execution speed. Next, in the implemetation you revised I lost the ability to have both forms open at once. Now when I use event driven programming this took care of the speed issue, similar to your use of case statements (w
ith elimited button polling) but again only one window open at a time.

I guess in summary I am looking for the most efficent way possible to have multiple forms open at once and have non choppy VI execution.
0 Kudos
Message 4 of 10
(4,603 Views)
Thanks a lot for your time Brooks, If you could look at my reply to GerdW to what I am looking for, would learning and implementing a VI server be the best way to concurrently run multiple VIs and pass data to them while having good execution speed? I downloaded an example that was called a Large App templete(Attached) and this is the only example I have seen that seems to emulate what I want, but its about 10x more complicated. In your opinion is this what I should be spending my time learning? Thank you again for your time.
0 Kudos
Message 5 of 10
(4,603 Views)
Hello NIBOUND,

you can have more than one window open...
Then you have to take care of execution speed and (perhaps) race conditions (when using globals etc.).
For the execution speed you should ALWAYS use some timing in the loops ("Wait ms" or for user interfaces
"Wait for front panel activitiy"). I think I put that into my examples. If you just want to display informations, then I would make those subVIs as a While
loop (with the mentioned timing) displaying the informations and waiting for a Global Stop-Button...
You can switch the panel on/off by using method "FrontPanel.On".

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(4,603 Views)
Thank you again for your help I am going to work on your new suggestions. I was saying I wanted to have all windows opening and functioning at the same time which is not possible with you implemenation.
0 Kudos
Message 7 of 10
(4,603 Views)
To access the FrontPanel.On method do I just fire an event or something? Or is there a specific way todo this that Im missing?
0 Kudos
Message 8 of 10
(4,603 Views)
Sorry, thats my mistake.
It should read property instead of method...
It's already in your example vi (OpenSubVi.vi).

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(4,603 Views)
Hi NIBOUND,

VI server is very powerful but also more complicated. I would stick to some of the simpler methods.

Have a great day!
Brooks W.
National Instruments
0 Kudos
Message 10 of 10
(4,603 Views)