LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer

Solved!
Go to solution

I have a State Machine with a subvi in it.  The code runs in the state machine then encounters the subvi.  The subvi pops up a display to the user a clock and a pressure measurement.  The clock counts down 2 mins while monitoring the pressure (loop).  A the end of the subvi loop the final pressure value is passed back to the main vi from which the subvi was called from.  This all works fine for me.  If there is a catastrophic leak and the pressure drops below a large amount..say 500 psi..there is no sense in continuing w the count down.  Can I use a producer/consumer routine such that if I put an abort button on the popup and the user hits it ( the producer) the subvi will end and return to the main vi??  Does this sound like its feasible and what producer/consumer is used for??  Where is Producer/Consumer in Labview 2014 ?  I can't find it in the examples or on any pallets.

 

Thxs

0 Kudos
Message 1 of 6
(2,281 Views)

From you description, it doesn't sound like you need a Producer/Consumer.  Just put the button on the dialog window to stop the loop.


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 6
(2,272 Views)

OK..thanks.  Do you know where those are in EXAMPLES and on the pallets of LV2014?

0 Kudos
Message 3 of 6
(2,264 Views)
Solution
Accepted by topic author Clint1000

I'm in 2019, but I think 2014 should have at least similar examples (it was around then that the examples got a major overhaul).  But the closest example I am finding is the Queued Message Handler Fundamentals.vi.


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 4 of 6
(2,248 Views)

I'm pretty sure that Producer/Consumer is present as a Template.  Open LabVIEW, go to File, "New ..." (the dots are important!), and expand "From Template" (under "VI").  You should see a couple of Producer/Consumer Templates, which have some comments explaining the basic idea.

 

Bob Schor

Message 5 of 6
(2,170 Views)

thanks..

0 Kudos
Message 6 of 6
(2,135 Views)