LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Code structure for data gathering—ways to avoid dynamic array size?

I have automatic error handling turned off, so I was not watching the errors. And I certainly did not do much error handling in this quick example, except that I use the error to stop the consumer loop.

 

I also did not do any testing to see that the tracks were truly handled properly. The maximum queue size never gets very large, but I think that is due to the random*10 values you use for the tracking algorithm.  The perfomance may not be as good when the tracks get really large.

 

This does not detect or handle the situation where it attempts to add more tracks than the Max tracks value.

 

One advantage of using queues this way is that the queue functions are highly optimized for placing items in queues and removing them, unlike arrays which are much happier when the size does not change.  Another possiblilty is to use a queue of arrays, because each array can be different size. However gaining access to an array (track) in the middle of the queue is not so easy.  That is why I stayed with the array of queues.  Also note that when I Release the queues used for the tracks I set the "force destroy?" input to be true. Read the detailed help file for more information.

 

Lynn

0 Kudos
Message 21 of 21
(261 Views)