LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue in Event Structure

HI NI Folks,

 

Does queue concept in Event structure works ??????

 

If yes, any ideas where I am doing the mistake.Please refer to the below post. 

http://forums.ni.com/t5/Machine-Vision/Queues-in-Image-Processing-Missing-a-very-very-small-concept/...

 

Regards

Neo.

 

 

PS: I have already posted this question in Vision discussion board. But I didnt get much response, not even views. So, I am posting it here

0 Kudos
Message 1 of 15
(2,081 Views)

Don't use the "queue status" function.  Just use the Dequeue Element.  If you want something to happen when you don't have any data, set a timeout and use the "Timeout?" output to control your case structure.


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 2 of 15
(2,070 Views)

Hello Crossrulz,

 

1)I just want to Implement Image saving code in Consumer loop. Now tell me what parameter should I queue in Producer loop and deque in Consumer loop for effective data saving from camera. I just Implemented as in my attachment because I found a working example in NI website. I just mixed the both.

 

2) I want consumer loop to save data when there is an element in queue (Whatever the element queued). It should be ideal when there is no element in Queue

 

3) Is there any function in Labview like 'Timeout?'  

 

3)Even with queue status function the example in the below link is working fine. But why my VI exactly with same design is not Executing the consumer loop ? Did I miss something ?

http://zone.ni.com/devzone/cda/epd/p/id/5859 

 

 

Regards

Neo.

0 Kudos
Message 3 of 15
(2,037 Views)

A queue executes when there's an item queued. If there's a timeout wired to the Dequeue it'll stop waiting after X ms and set the timeout output. It's common to have some default action done in a timeout case and the real actions performed in the dequeued state.

 

What to queue? The same data you define when you create the queue. 😛 If you create a queue with Integer input you can only queue integers and when dequeuing you'll get integers, but you can also create it with type defs, arrays, variants ...

 

Why your producer/consumer isn't working? Open the producer/consumer template and play around until you understand it, are you enqueueing/dequeueing correctly?

 

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 4 of 15
(2,012 Views)

As I said, don't use the Queue Status.  Use the Dequeue Element.  When data is sent by the producer, the consumer will grab it and process it.  If you setup the queue to send the image, then the consumer will read an image from the queue and process/save it.  The Dequeue Element has a Timeout input.  This sets a timeout so that if no data is recieved, you can still do something in that loop.  If you just want it to be idle, don't use the timeout.


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 5 of 15
(1,996 Views)

Hello Yamaeda,

 

Thank you for your reply. I followed the suggestions here... finally my VI is working fine.

 

Regrding my question 'what to queue', my question is In Image preocessing (in general)  if we want to process some image data in consumer loop, we can queue either bufffer number or Image itself or may be any other parameters (I dont know, I am not expert).  For effective working of P/C loop with Images, which is the best parameter to queue in ????

 

Regards

Neo.

0 Kudos
Message 6 of 15
(1,973 Views)

Hello Crossrulz,

 

With ur advice , by using dequeue function and its timeout terminal, My VI is working like miracle. Problem solved.

 

So I decide to paly lil bit with that queue status funtion. I used a time delay in no element case . Then consumer loop worked for few iterations, but still some elements in the queue were not processed by consumer loop..

 

My question is Whats happening to those missing elements ??? Since queue size is infinite there is no chance of overwriting. Even at the end of all  iterations , I used queue status function to check whether there are some elements still remaing in the queue, but it returned zero elements.  Where are those missing elements ????

 

Regards

Neo. 

0 Kudos
Message 7 of 15
(1,965 Views)

Post your code. It is impossible to identify the issue without seeing your code.



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 8 of 15
(1,963 Views)

Hi,

 

Mark is right. Please post your code to clarify what has to be changed.

 

Best regards

Suse

______________________________
Certified LabVIEW Developer (CLD)
0 Kudos
Message 9 of 15
(1,953 Views)

Hello Mark ,

 

This is how I modified the code, queing numbers  in P/C loop. 

 

Regards

Vaidhin.

0 Kudos
Message 10 of 15
(1,926 Views)