ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
07-22-2008 01:03 AM - edited 07-22-2008 01:05 AM
07-22-2008 09:26 PM
07-23-2008 04:50 AM
07-24-2008 10:24 PM
Hi mumech,
I believe that the best method for keeping track of your angular position while acquiring data is to periodically compare the number of acquired data points with your measured angular position. You can do this by running both tasks in parallel and having both Reads in the same while loop. In order to implement this, you will have to accumulate your data in an array and make sure that you empty the buffer at every read by setting the number of samples to read to -1. It's always possible that you might get into a race condition depending on how fast your encoder is working. So the safest method would be to simply make this comparison once the task has finished.