05-08-2008 08:58 AM
05-08-2008 09:42 AM
05-09-2008 02:28 AM
05-09-2008 04:16 AM
05-09-2008 10:32 AM
Sounds like JB's answers are helping you, but I just wanted to mentio
In your original question, you mentioned wanting to sample an analog signal on every quadrature encoder tick. The M-series boards have a "change detection" capability you can use for this.
1. Wire the quad encoder A,B both to a counter's inputs AND to 2 digital input lines on port 0.
2. Configure a digital input task using "change detection" as the timing type. Make it sensitive to both rising and falling edges of the encoder A,B signals.
3. Configure your encoder and analog tasks to use the "change detect event" as their sample clock source signal.
4. Now, on every quadrature state change of your encoder, you'll capture both a position sample and an analog sample. They will be in sync because they use a common sample clock.
5. If you need accurate time information, you can configure your 2nd counter to do freq measurement on the "change detect event", and later calculate your actual cumulative time from the array of freqs.
-Kevin P.
05-09-2008 11:36 AM
05-11-2008 03:12 AM
06-10-2008 07:18 AM
06-13-2008 07:22 AM
Both the analog and encoder tasks should include a call to DAQmx Timing. One of its inputs lets you wire in a programmer-specified source for the task's sample clock. Create a control or constant by right-clicking on one of those inputs. Then right-click on the resulting control (or constant) and choose to show advanced terminals. Now you should get a longer list of options and somewhere in that list is something like "dev1/ChangeDetectEvent". That's the internal timing signal generated by your digital change-detection task. Wire this control/constant to the DAQmx Timing vi for both the analog and encoder tasks.
-Kevin P.
06-16-2008 03:20 AM