LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain queue returns error 1094

Hi! List,
In my application I want to create two queue of the same data type(dbl) but different names. The reason for using two different queue is because I want to dequeue elements from first queue and I retereive certain amount of data (say 11 elements) from the first queue and fill the second queue.
Now once the second queue is filled with 11 elements then after that I dequeue one element from the second queue and enqueue top element from the first queue. This way I always throw the last element and insert the new element so the number of elelments are always 11 in the second queue.
On using the Obtain queue function to create two different queue, it returns an error code 1094. Is there any way of generating two queue with same
data element type? Do I need to use any other function????
TIA
Rachana
0 Kudos
Message 1 of 5
(4,666 Views)
Well the program is working so thanks for the help.
Thanks!!
Rachana
0 Kudos
Message 2 of 5
(4,663 Views)


@Rachana wrote:
Hi! List,
In my application I want to create two queue of the same data type(dbl) but different names. The reason for using two different queue is because I want to dequeue elements from first queue and I retereive certain amount of data (say 11 elements) from the first queue and fill the second queue.
Now once the second queue is filled with 11 elements then after that I dequeue one element from the second queue and enqueue top element from the first queue. This way I always throw the last element and insert the new element so the number of elelments are always 11 in the second queue.
On using the Obtain queue function to create two different queue, it returns an error code 1094. Is there any way of generating two queue with same
data element type? Do I need to use any other function????
TIA
Rachana



Hai

Am using an Queues in my application. Am in a trouble with using it, so i was hope full that you would be able to solve my problem.

Am using a thread which fills the Q, and another thread which reads from the Q and writes it in the COM port, there is also an high priority thread which fills the same Q but in the opposite direction(A function has been provided in LV). My problem is if the Q gets filled up i will not be able to enter the elements from high priority thread, so i need to remove few elements from the starting of the Q, i.e where the normal priority thread is writing. Do you think it is possible in any way?

Hopeing to get a reply

Arun
0 Kudos
Message 3 of 5
(4,659 Views)
Error 1094 will occur if you are using multiple Obtain Queue functions with the same name, but they are defined with different element data types. If you want to queue different data types, you will need to either type cast all of the data to one data type or use a different queue for each data type.

Refer to KB 3927JKCH: Why Do I Get Error 1094 in LabVIEW?

There are also some good example programs in LabVIEW for queues that might help. 🙂
Message 4 of 5
(4,655 Views)
Hi Arun,

Take a look at some of the example programs for Queues that ship with LabVIEW. In particular, look at the Queue Multiplexer for an example of how you can have multiple souces of input into a single queue and how you can continue to dequeue elements from that queue at the same time to prevent the queue from filling up. Also, take a look at the Queue Stack - Solve Maze.vi for a demonstration using the Enqueue Element at Opposite End. You might also want to think about using a Producer Consumer design pattern (the template VI is also available in LabVIEW >> New...) where the producer loop is the loop enqueueing items to the loop at a higher priority while the consumer loop is dequeueing items from that loop at a slower rate.

Hope this helps.
Message 5 of 5
(4,654 Views)