10-14-2015 04:05 PM
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
10-14-2015 04:07 PM
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> ---'
10-14-2015 04:13 PM
Snippet attached, still not quite sure what the problem is, or how you've determined that it is a problem with the queue.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-14-2015 06:50 PM
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?
10-15-2015 05:47 AM
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
10-15-2015 09:51 AM
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.