LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing variant data in queues Error code 91

Solved!
Go to solution

Task:

pass variant data in a cluster as a queue data type, i.e., bundle a boolean and a string (the string is converted to a variant).  Create two while loops (producer + consumer).

All works fine in the consumer using Variant to Labview data function IF timeout for the dequeue function is -1.  Then when data is sent (as a response to a button press in the producer) the data is received and displayed correctly.

However change the timeout of the consumer to say 500ms, then each time timeout occurs Error 91 pops up as shown in the attachment.

 

I would like to know what I am doing wrong, as it is not completely obvious to me why it works with infinite timeout but not 500 ms timeout.

 

0 Kudos
Message 1 of 3
(4,766 Views)
Solution
Accepted by topic author mpencke

Hi,

When "dequeue" timeouts the function provides a empty cluster as output.  When you try to convert a blank to a type of string it throws an error.

 

Just dont pass the data to the conversion operation when the dequeue tiimeouts.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 3
(4,759 Views)

It is a simple enough item to include in the help file.  I guess no one has done so because it is so obvious to many, but it remains an undocumented behavior none the less.  Thanks for the quick reponse!

0 Kudos
Message 3 of 3
(4,726 Views)