From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues and notifiers

I am trying to implement a master slave design as shown in the VI attached. The main loop acquires temperature and pressure data and displays it. I would like to trigger loop 1 and 2 from the main loop using queues and/or notifiers.  My knowledge in this area is limited and I would like to know if there is a better way to make this work. Any suggestions and corrections are appreciated.

0 Kudos
Message 1 of 4
(2,464 Views)

Queues and notifiers are the right way to go. I think you may misunderstand the event structure though. Your timeout event essentially looks like your state machine. This should probably be in its own loop separated from the UI events. You want to respond quickly to the user events (button presses or whatever) and as written you could potentially stay in one of the cases (you state you will continually acquire data in one case) and that would prevent you from processing any other events. You generally want to keep all processing in event cases as fast as possible.

 

I would create a true state machine that will run your image collection. Depending on what you are doing here and how quickly you need to get the images you may or may not want process them here. If the processing is fairly fast than you can do it here. If it will take longer do it in another task (parallel loop). At the moment you are passing a cluster that only contains a Boolean. You might want to pass more meaningful messages in your queue/notifier. If you use a cluster with a message ID (typedefed ENUM or string) and specific elements for the message data you can consumers can do more than simply chose between true and false. Your consumer can process a wider range of messages. If your data is very large you may need to consider a way to operate on a single copy of it. Posting to a queue will result in a copy of the data and you can take a performance hit if you are continually copying large amounts of data.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(2,442 Views)

Ok so here's my attempt at your solution.I decided to have most of the data processing in separate loops. The idea with the event structure was to have a timer  to trigger  events (feed, log, vision) and also be able to use buttons on the UI. I'd also like to get continous images (video) and apparently thats not happening.

0 Kudos
Message 3 of 4
(2,387 Views)

Charles,

 

I don't know wether you cruised through the examples yet, but this one is pretty good if you want to get to know the basics.

 

Goto your LabVIEW folder in program files : examples\general\queue.llb\Queue Basics.vi

 

If it not good enough, just let me know, and I will make a custom made VI for your needs.

But I'd rather have you to find it out for yourself, cause you will learn the most of it.

 

Kind regards,

 

Bjorn

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
0 Kudos
Message 4 of 4
(2,366 Views)