LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Elements added to the queue are disappearing

Solved!
Go to solution

Hi all,

 

I am having an issue with a queue, I am pretty sure it is a simple solution but I am just not seeing it, so I though I need more eyes to check it.

 

I am using a Queued Message Architecture and I used a separate parallel loop to keep track of the time the program takes to run one part in my equipment. So I have a queue to keep track of my time and one to update my program UI. In this loop I am just waiting for one second and then updating the UI to reflect the amount of seconds that have passed.

 

The weird thing is that the first time that the loop executes it does it correctly and my main VI with the UI recieves the message and updates the 0 in the UI, but for all subsequent executions of the same state in the program if I use debug or probes I can see that the enqueue function is being executed, and no error is being generated, but the update time message never makes it to the main application after the first one.

 

Note: I should also point out that this specific UI queue is being used by other queues with no problem, this Loop seems to be the only one having this issue.

 

Thanks!

Timing Loop.PNG

0 Kudos
Message 1 of 6
(4,738 Views)
Solution
Accepted by topic author cesquivelf23

No one is going to be able to debug this without more information or seeing the rest of your code. Who knows why you aren't seeing it - it could be that queue is getting overflowed with other messages, it could be you aren't ever calling dequeue again, etc. 

Message 2 of 6
(4,721 Views)

@cesquivelf23 wrote:

Note: I should also point out that this specific UI queue is being used by other queues with no problem, this Loop seems to be the only one having this issue.


As has been said, we don't have sufficient information to debug anything, but your sentence above is curious. What does "used" mean? If you also read the queue in other places, the element is removed there. What's the name of your queue functions? Are they from a toolkit? How do they differ from the stuff in the plain queue palette? What's the function of the blue (coerced) input?

Message 3 of 6
(4,688 Views)

The weird thing is that the first time that the loop executes it does it correctly and my main VI with the UI recieves the message and updates the 0 in the UI

 Go back and check the UI Queue code.  As shown by your code, the first time the loop executes the value at Probe 1 should be a 1.

Michael Munroe, CLD, CTD, MCP
Automate 1M+ VI Search, Sort and Edit operations with Property Inspector 5.1, now with a new Interactive Window Manager!
Now supports full project automation using one-click custom macros or CLI.
Message 4 of 6
(4,687 Views)

@paul.r wrote:

 it could be that queue is getting overflowed with other messages, it could be you aren't ever calling dequeue again, etc. 



Thanks!

That is what I needed, more ideas in what could be happening. You were right! The queue was getting overflowed with other messages.

 

When I start the timing in a different function at the same time I start a camera so I request reading of each frame, the problem is that I made a mistake and was requesting each frame in one loop and using the function to get it in a different one, so the queue was filling with request for frames, but the camera is obviously not as fast.

 

So the first time it worked because the queue was not filled up, but later it was not that it was not working but only that there were so many requests for the camera that the updates in time were delayed.

 

Thank you very much!

0 Kudos
Message 5 of 6
(4,672 Views)

@altenbach wrote:

@cesquivelf23 wrote:

Note: I should also point out that this specific UI queue is being used by other queues with no problem, this Loop seems to be the only one having this issue.


As has been said, we don't have sufficient information to debug anything, but your sentence above is curious. What does "used" mean? If you also read the queue in other places, the element is removed there. What's the name of your queue functions? Are they from a toolkit? How do they differ from the stuff in the plain queue palette? What's the function of the blue (coerced) input?


Looks like the queue library from the QSM template project. 

0 Kudos
Message 6 of 6
(4,668 Views)