LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI's deadlock when passing msgs using queue's.

Morning,

I am having some trouble with my VI's locking up when using a queue. I have one main test application VI which calls a number of support VI's via the Invoke Node. Each VI is running independent of the main test application. I am using queues as the primary method of  passing messages back and forth between the main VI and the support VI's. I was trying to save CPU cycles, so I wanted to have all the support VI's only react when a message was enqueued. The way I understand queue's to work, I just need to set the timeout to "-1" of the get next queue VI. However, as soon as I do this, both the support VI and the main VI lockup. So for some reason unknown to me, the queue in the support VI is keeping the main VI from executing. I have included a simplified version of my VI's here. I would love to know when the heck I am doing wrong.

 

I think I have included all the files.

 

Thanks

0 Kudos
Message 1 of 6
(2,990 Views)

The QMH subVI's are missing.

 

Without seeing what is going on in those VI's it is impossible to tell what might be wrong.

0 Kudos
Message 2 of 6
(2,982 Views)

I downloaded the QMH VI's from NI's site. I tried to post it but it is apparently too big (ie > then 5.12MB). So instead I attached the help doc. I will try and find a link to it soon.

 

Regards

0 Kudos
Message 3 of 6
(2,970 Views)

I cannot open the VI because I dont have LabVIEW on this computer but this is what I suspect is going on:

If you have a Dequeue Element inside a loop, with -1 wired to the timeout, there is no timeout.

This means that unless there is an element in the queue, you will never exit that iteration.

So rather than polling and checking the queue periodically, it will wait indefinitely at the first iteration.

Cory K
0 Kudos
Message 4 of 6
(2,957 Views)
I searched all over the place on NI's site, but could not find the library. So I took the one I had and compressed it again with the Winzip setting which optimizes the compression type for each file. It said it may not be compatible with older versions. Hopefully this works.
0 Kudos
Message 5 of 6
(2,935 Views)
I was not able to unzip this file with several compression programs including Winzip. I think Cory is on the right track as to why this may be happening in your VI - is it possible for you to set a timeout value apart from '-1'? It looks like it may be waiting for an element to be enqueued indefinitely.
Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 6 of 6
(2,910 Views)