Jump to content

Popup Window Disrupts Data Acquisition


Ano Ano

Recommended Posts

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.

Link to comment

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.)

Link to comment
  • 2 weeks later...

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

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.