LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

queue performance

I have a 5K count per rev encoder and the queue doesn't seem to be able to capure all the daqmx output. With just a quick turn of the shaft by hand the queue will miss 1/4 or more of the output. Is there a better way to code the task? The counter task easily captures all the counts but the queues don't.

See attachment pls.

sc

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

I can't see your VI unless you include a snippet, or save it in 20214, but it sounds like you may be trying to handle an enqueue'd element for every single datapoint? If you can pull chunks of data instead of one datapoint at a time, you can handle an array of data much easier than each datapoint at a time.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


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

Snippet attached, still not quite sure what the problem is, or how you've determined that it is a problem with the queue.

 

Count and Period r2_BD.png

0 Kudos
Message 3 of 6
(3,739 Views)

How many times are you revolving your shaft?  At 5k counts/rev, you should be able to handle 2 revolutions before losing queue data.  On the other hand, I don't see you dequeueing anything either.  What are you trying to do with the data?  And why do you need every count change?  Do you really just need the latest value?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(3,709 Views)

These loops are test setups to define the problem. The application requires measuring motor shaft speed when the brake is applied to determibe the mechanical forces on the shaft. Since the braking period is short I don't want to miss any data points. Yesterday I noticed the number of elements in the queue did't match what I expected so I put together these loops to figure out what was going on. The top loop was to verify the encoder counts, and it counts 5k no matter how fast I turn the shaft; however, the number of elements in the queue only keep track if the shaft rotational speed is pretty slow.

The bottom loop is used in the actual application code with the degueueing omitted here for simplicity. I assumed making a period measurement between two data points would be better than an averaging type for dynamic deceleration.

sc

0 Kudos
Message 5 of 6
(3,665 Views)

Here's the problem with your logic: you don't know when those counts happened.  If you really care about every sample, then you need to know when the count was taken.  So you need to add a timestamp to your sample that is going into the queue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,631 Views)