LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping producer/consumer loop with queues handling using single stop button

Download All
0 Kudos
Message 1 of 8
(4,259 Views)
0 Kudos
Message 2 of 8
(4,252 Views)
0 Kudos
Message 3 of 8
(4,251 Views)

Hi there.

I had a problem with browser, now installed the latest version. Lets see if my message get posted.

I am after stopping producer and consumer loop with one stop button. Latch operation for stop button would not allow local variables added to do this operation.

I had attached in the message above snippet and vi. Any thoughts on that?

Kind Regards

Austin

0 Kudos
Message 4 of 8
(4,241 Views)

One way is to send a Halt command to the consumer loop via the queue.  After the code executes the Shutdown case, wire a True to the stop terminal of the loop.  For your system, you might consider separating the Shutdown and Error Handling into different states unless every error will force a shutdown.  If an error forces a shutdown, then you need a means of notifying the Producer loop that the Consumer has shutdown.

 

Why do you have the Event structure inside a for loop set to iterate 10 times? To send anything to the queue the user would need to push the Confirm Input or Stop buttons a combination of 10 times before anything goes into the queue.  To stop the loop the last of those ten presses would have to be the Stop button. 

 

Lynn

 

 

0 Kudos
Message 5 of 8
(4,236 Views)

Ya thats right.

I want user to hit Input everytime he enters the new value. When he added ten values, the mode value is calculated and displayed with the whole array of ten elements. I am just implementing everything coming in my head and refining Labview skills. I want to sit in both the test for CLAD and CLD same week. What is the best way to prepare?

 

Kind Regards

0 Kudos
Message 6 of 8
(4,228 Views)

Instead of sending the input value in the queue, try sending the enum each time a  button is pressed.  Read the input value in the acquire  case and decide if you have enough values or an error.  Read the stop button in the shutdown case. No variables required. 

0 Kudos
Message 7 of 8
(4,224 Views)

Before you sit for the exams make sure you understand dataflow and how the event structure works.  There are several threads on the Forums (this one and in Breakpoint) about preparing for the exams.

 

Turn on execution highlighting and run your VI.  Try to stop it after three data points have been entered.

 

Lynn

0 Kudos
Message 8 of 8
(4,221 Views)