02-27-2009 12:41 PM
To replicate the functionality of the missing Queue function "Lossy Enqueue", you ought to create a small subvi that checks the capacity of the queue, and first removes the oldest element from the queue if it is full before adding the latest image frame. This can be achieved using a combination of Get Queue Status, followed by Dequeue Element if the queue is full, then Enqueue Element.
The example you found (Queue stack - LIFO) simply demonstrates how to remove elements from the opposite end of the queue such that you receive them in the opposite order to that in which they are posted.
03-04-2009 03:06 PM
Thoric wrote:To replicate the functionality of the missing Queue function "Lossy Enqueue", you ought to create a small subvi that checks the capacity of the queue, and first removes the oldest element from the queue if it is full before adding the latest image frame. This can be achieved using a combination of Get Queue Status, followed by Dequeue Element if the queue is full, then Enqueue Element.
The example you found (Queue stack - LIFO) simply demonstrates how to remove elements from the opposite end of the queue such that you receive them in the opposite order to that in which they are posted.
I'm sure you're reply is as simple as you can make it, but I'm still lost as to how to implement the Get Queue and Dequeue into my program... I looked at the examples and they kind of make things worse as far as me trying to figure out what's going on.
03-05-2009 06:00 AM
I havn't tested this, but I believe it should work.
This snapshot shows a subvi that will operate like a 'lossy enqueue' function.
It first checks the status of the queue. If the maximum capacity matches the number of elements in the queue, then it must be full, in which case it removes the oldest element. It then enqueues the new element.
I've used an image cluster as my element type, obviously you need to replace this with whatever element type you are using.
Thoric
03-05-2009 11:35 AM
03-05-2009 12:05 PM
03-05-2009 12:41 PM
Ok so once I open a new subvi how do i connect it to my main VI with my video recording program on it? I looked in the help and it said to make a connector pane but when I right click on the icon on the top right, the option Show Connector isn't there...
Also, what do I put for "new image element" and "queue ref in, and out" ?
03-05-2009 01:17 PM
You have to click the icon on the Front Panel, not the icon on the Block Diagram pane.
On second thoughts, to make this easier for you, don't create a subvi out of the code in my example, just place it directly into your main code. Doing this means the two "queue status" inputs simply come from your existing queue functions, and the third input (new image element) is simply your image as captured from your camera.
Although LabVIEW style guides recommend the use of subvis for making neater, easier to understand, reusable code segment, we'll let you off this time 😉
03-05-2009 02:18 PM - edited 03-05-2009 02:18 PM
03-05-2009 03:30 PM
Ok, hopefully some guidance will help:
03-30-2009 12:59 PM
Ok I know this is frustrating but believe me I am trying my hardest to grasp this information.. I need to get this to work by the end of April so I can graduate college and this part is our biggest burden.
You said I need to wire my image from the camera in place of your new image element cluster, but I'm having problems doing that. Do I need to make the program that you made into my program as a SubVI? Also, I don't currently have any queue references in my existing code do I?