Ano Ano Posted November 3, 2011 Report Share Posted November 3, 2011 Hello, I have a .vi that constantly acquired data in a while loop. In the while loop I placed a code with a case structure. When the case is true (button pressed) a popup window (subvi) opens up as a "Help" file for the user. The operation is identical to http://forums.ni.com/t5/LabVIEW/make-pop-up-window/td-p/1587340 The problem is that while the popup window is active the while loop does not acquire any data. It waits for the popup to close (case structure to turn to false or finish). If the popup stays open for a while then the program displays a message that it tried to acquire samples that are no longer there! I tried to do this with an event structure and got similar problem. How can I run the case structure in parallel to the data acquisition? Thank you in advance. Quote Link to comment
Daklu Posted November 3, 2011 Report Share Posted November 3, 2011 Any single-loop system is going to have this problem. The dialog box prevents further execution until the user dismisses it. There are two solutions: 1. Put your UI operations in one loop and your data acquisition operations in a separate loop. Splitting functionality into separate loops is the fundamental way to get parallelism in LV. If you plan on writing code with anything more than trivial user interaction, you need to learn how to manage multiple loops. 2. Write a vi that opens the dialog box and dynamically launch it using VI Server calls. This is okay if you just have a one-off thing you want to add without having to start a significant rewrite. (Note: You will have a hard time trying to scale your user interface without it getting out of control. Once you're very comfortable with multi-loop applications you can take a look at the Actor Framework for ways to dynamically launch parallel loops.) Quote Link to comment
Ano Ano Posted November 14, 2011 Author Report Share Posted November 14, 2011 Any single-loop system is going to have this problem. The dialog box prevents further execution until the user dismisses it. There are two solutions: 1. Put your UI operations in one loop and your data acquisition operations in a separate loop. Splitting functionality into separate loops is the fundamental way to get parallelism in LV. If you plan on writing code with anything more than trivial user interaction, you need to learn how to manage multiple loops. 2. Write a vi that opens the dialog box and dynamically launch it using VI Server calls. This is okay if you just have a one-off thing you want to add without having to start a significant rewrite. (Note: You will have a hard time trying to scale your user interface without it getting out of control. Once you're very comfortable with multi-loop applications you can take a look at the Actor Framework for ways to dynamically launch parallel loops.) Hello and thank you for the help. I tried No1 and it works without disrupting the acquisition, but while the popup window is on, I have no access to the main window buttons. I tried the rendezvous function but I get the same problem As for No2 I am clueless! Can you please give me more info? Thank you in advance Quote Link to comment
ShaunR Posted November 14, 2011 Report Share Posted November 14, 2011 I have no access to the main window buttons. Set the dialogue window to "floating" Quote Link to comment
drjdpowell Posted November 14, 2011 Report Share Posted November 14, 2011 If all your doing is showing the User information, you have a third option to Daklu's two. Just have the subVI open its front panel and display the information, then immediately finish (but leaving the front panel open). To modify the example from the conversation you linked to, just delete the loop and the "Stop" button. I think you need to select "Show front panel when called" and NOT select "Close afterwards if originally closed". And make sure it isn't "Modal", as ShaunR suggests. The User can close the window when they don't the info anymore. -- James Quote Link to comment
Daklu Posted November 14, 2011 Report Share Posted November 14, 2011 As for No2 I am clueless! Can you please give me more info? It's far to big a topic for me to explain it in a forum post. Search Labview help for "run vi method". Include the quotes in the search string. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.