Jump to content

Connecting a GUI with the main loop


Recommended Posts

Hello all,

I need your help to understand how to connect a GUI with main loop in the parent VI. Please think in the following situation. I have a main VI which calls asynchronously a subVI containing the GUI, which basically it have to send commands and parameters back to the main loop. The only way I know to send back data is by using in the main loop an invoke node configured to get/set the value of a control in the GUI control panel. But... what if I want to send data which is not in a control or indicator, but it is the result of a calculation/decision (such a command), there is a way to return data which is not shown in the GUI?? (without adding a hidden control in the front panel...)

I have spend quite a lot of time browsing for the solution, but I think I'm not using the correct keywords because now I'm more confused that at the beginning.

thanks!

felipe.-

 

Edited by Felipe
Link to comment
50 minutes ago, Tim_S said:

Try searching model view controller (MVC). You are trying to get two loops to communicate, which there are lots of examples of (and even more ways to implement).

Or the Muddled Verbose Confuser pattern, as I call it. :lol:

That must be the worst pattern ever invented. No-one can agree what should be in what bits. No-one ever puts the right bits in the right place after they have argued about it and everyone ends up with MC, MV or one of the other letter combinations (take your pick). Then every single one of the gazillion files only has one of 3 names (controller, view and model) :wacko: In theory it's great. In practice it's foot shooting with a bazooka.:D

1 hour ago, Felipe said:

which basically it have to send commands and parameters back to the main loop.

Look at the "Event" examples that ship with LabVIEW. In your GUI you probably already have an event structure so create a "User Event" and get your GUI to register for it.

Edited by ShaunR
  • Like 1
Link to comment
39 minutes ago, ShaunR said:

Or the Muddled Verbose Confuser pattern, as I call it. :lol:

That must be the worst pattern ever invented. No-one can agree what should be in what bits. No-one ever puts the right bits in the right place after they have argued about it and everyone ends up with MC, MV or one of the other letter combinations (take your pick). Then every single one of the gazillion files only has one of 3 names (controller, view and model) :wacko: In theory it's great. In practice it's foot shooting with a bazooka.:D

Any chance you have a strong opinion on it? :lol:

  • Like 1
Link to comment
4 hours ago, Felipe said:

The only way I know to send back data is by using in the main loop an invoke node configured to get/set the value of a control in the GUI control panel.

Spend some time learning about Queues and User Events, and the concept of a loop handling messages.  Forget about Get/Set invoke nodes.

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.