LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to control the number of elements read from queue

Solved!
Go to solution

The data write into the queue follows the format of

 

(Data Length) + Data Block + (Data Length) + Data Block + (Data Length) + Data Block

 

When I read the data, need to read the Data Length first, then can read one Data Block.

 

Is there any function  in queue to do it?

 

Thanks

0 Kudos
Message 1 of 3
(2,752 Views)

Hi turbot,

 

"Is there any function  in queue to do it?"

 

No, but there is the FOR loop to fetch datalength elements from the queue.

Or use the "flush queue" command the empty the queue - but you have to parse the element array afterwards...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,741 Views)
Solution
Accepted by topic author alex.
You can only dequeue data in the same form as you enqueued them. So, if you enqueue 3 data blocks at once (in which form? String? Byte array?), you will only be able to extract all 3 blocks at once; you later need to parse the extracted data accordingly.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 3 of 3
(2,735 Views)