LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pause a queue when a number of element in dequeue is reached

Hi Experts,

 

I'm new in LabView programming so please don't get rude on me. I have attached a VI that continuously gathers the temperature reading but got stuck on how to implement its flow discussed below:

 

  1. A Producer/Consumer is implemented. The producer will enqueue the reading and the consumer will dequeue them.
  2. When the dequeue elements have reached a required number, say 10, I'd like to pause/stop the enqueue state and compare the 10 elements in the appended array after they have been dequeued. 
  3. When it's TRUE (all the 10 elements in the appended array holds true), it will take the last dequeued element and fire up an event in the case structure. Then the program will ask the user to start the process again by asking the fluke set and threshold.
  4. When it's FALSE, it will resume the enqueue/dequeue by removing the first 10 dequeued elements and place the new 10 elements to the appended array.

Is this possible? Your feedback is very much appreciated.

 

Thanks,

 

Johnny

0 Kudos
Message 1 of 2
(2,347 Views)

It sounds like your application is fairly simple, and if you're new to LabVIEW too, I suggest that you don't need a producer-consumer architecture here. Consider a single loop instead. Then you can use a shift register containing an array (which you have already). When it reaches 10 elements, which you can check using the Array Size function, do the comparison and prompt the user if necessary. When you restart, wire an empty array to the shift register, which will clear the array.

 

You need to be clearer about what you want to happen. Your code enqueues floating point numbers, but your text says "all the 10 elements in the appended array holds true" - which sounds like a boolean. Also, you are enqueuing an array, but it sounds like you meant to enqueue single elements.

0 Kudos
Message 2 of 2
(2,340 Views)