05-01-2006 06:23 PM
05-02-2006 06:40 AM
I only use LabVIEW so I can't address any of the .net syntax at all. I can only comment on the hardware capability.
Unfortunately, no, you cannot set up a single encoder acquisition task to buffer on either Rising OR Falling edge. You should be able to set up 2 separate tasks though, with one set to acquire on Rising and the other set to acquire on Falling edge. However, if you do it that way, you'll have used up both counters and you probably won't be able to "peek" at the instantaneous count while waiting for those sensor transitions.
The other way that may work is to perform a Digital Input on the sensor signal using "Change Detection" rather than a regular sampling clock. Change detection can be set up to respond to either type of transition, and it started being available for M-series boards in DAQmx 8.0 You will also need to figure out how to use the Change Detection Event/Pulse as the sampling clock for your buffered encoder task.
What you can then have is 3 tasks -- 1 unbuffered encoder task that you can "peek" at anytime, 1 buffered Digital Input task that captures your sensor state whenever it changes, 1 buffered encoder task that captures position at the change detection instant when your sensor changes state. The buffered digital data will correlate to your buffered encoder data so you can know for sure which type of sensor transition corresponds to each captured position.
As to the .net stuff, sorry but I've got no experience at all. Just wanted to give you a rough roadmap for the things that ought to be possible so you'll know it's worth pursuing the details.
-Kevin P.