LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User event architecture question

Hello.

 

I have some doubts about using User events in application because I have small experience with them

I want to split program into 3 loops: GUI, IO and Processing module.

There is also some async thread running in background working on Listbox.

GUI needs to sent and get data from IO.  

 

 

So this is what I am thinking:

Async user event for listbox functionality

To GUI user event for Init/shutdown etc and way to sent messages to gui

Queues for other loops

 

I have written simple concept here:

Architecture.png

 

My intuition says this is a bad idea but couldn't come with something better tooday...

0 Kudos
Message 1 of 16
(3,490 Views)

pawhan11 wrote:

My intuition says this is a bad idea but couldn't come with something better tooday...


What's wrong with this setup?  I use it all the time.  Just be careful about when you close the references to the queues and user events and be sure to use commands through the queue to close down your queued loops.


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
0 Kudos
Message 2 of 16
(3,478 Views)

I also use this setup.  One thing I do is put all of my Synchronization references and user events into a FGV so I don't have the wires cluttering up the diagram.  Personal preference.

refs.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 16
(3,470 Views)

I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires. My teacher used to put them all into cluster to get only one wire.

 

My concern is because in GUI I will for sure have have some popups/login/panels/forms and other stuff that blocks this loop and waits for user interaction. When IO writes some important message when Popup is active it won't be serviced until popup is finished by user...

0 Kudos
Message 4 of 16
(3,462 Views)

Put the popup in your consumer loop....not in the event structure.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 16
(3,459 Views)

@pawhan11 wrote:

I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires.


I make an Action Engine for each of my communication Queue/Notifier/Event.  That way I don't have to pass any wires around and anybody can send a message to anybody else.

 

You can check out my templates here: http://lavag.org/topic/16171-new-messaging-vis/


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 6 of 16
(3,446 Views)

@crossrulz wrote:

@pawhan11 wrote:

I also put those references in FGV or in Global variable as variant atributes to avoid these annoing vires.


I make an Action Engine for each of my communication Queue/Notifier/Event.  That way I don't have to pass any wires around and anybody can send a message to anybody else.

 

You can check out my templates here: http://lavag.org/topic/16171-new-messaging-vis/


I have to look at this.  It sounds SWEET.

 

[edit]

oops, kudos

[/edit]

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 16
(3,410 Views)

Moving some things to other loop solved my problem.

 

I had other idea tooday.

I always wanted to handle all GUI in one loop. Placing all controlls in tab controll switch pages and resize app window at runtime to make it look good.  Is that good practise??

0 Kudos
Message 8 of 16
(3,375 Views)

@pawhan11 wrote:

I had other idea tooday.

I always wanted to handle all GUI in one loop. Placing all controlls in tab controll switch pages and resize app window at runtime to make it look good.  Is that good practise??


That's what I do.  And then I update the GUI from other threads using User Events that the Event Structure is registered for.  Makes things a lot simpler when you can separate things like that.


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
0 Kudos
Message 9 of 16
(3,365 Views)

Thanks for reply. 🙂

 

I attached simple concept of what I mean. You are doing it like that?

 

So I can resize FP bounds and change active tab to allow user see what He needs, keeping all clean in one loop without Popup windows..

 

But some things trouble me. FP bounds reffer to global screen coordinates. So changing resolution and monitor may cause some problems. So next step would be to get resolution and make it scalable for different resolutions ?

0 Kudos
Message 10 of 16
(3,356 Views)