03-11-2008 01:28 PM
I have a 2 channel quadrature encoder with Z-indexing and a NI-
Thank you very much
Noel
03-12-2008 04:59 PM
Hello Noel,
If I understand correctly you want to be able to change the type of counter measurement you're making on the fly from frequency to position. If this is the case it's not possible while the task is running, but I do have a couple of suggestions.
1. You could do this change in software by stopping the counter input (CI) frequency task and then configuring and starting the CI angular position task. This would inherently have a delay between stopping one measurement and stopping the other, but it would allow you to make the change you want. To implement this you'd basically combine two example programs and run one after the other. Take the CI Frequency example and add a case statement so that it exits the while loop when a certain value is reached. Then, at the end, paste in the CI position example to start that measurement.
2. This would be my personal preference of how to achieve this goal. Essentially frequency (velocity) and position are equivalent values when they are associated with a known time. What I mean is that you could technically only measure position (or frequency) the entire time and just calculate the velocity (or position) from this measurement since you know the time between samples (Velocity = distance/time = (PositionX- PositionX-1)/(TimeX-TimeX-1)). Using this approach you'd be able to have a graph of both position and velocity available for the entire test. To implement this method just use one of the examples and add some analysis to the loop to calculate and graph the velocity or position. You also have the option of calculating the velocity or position in a post-acquisition step if you run into issues with the processing time.
I hope this helps get you started. Have a great night!
03-12-2008 05:07 PM