05-05-2010 02:43 PM
I am trying to program digital channel as a gate to the counter. I would like to measure pulse width on more then 2 channels. For example, the default ones are PFI4 and 9. I like to have more gate inputs.
Can I do it?
Thank you
Solved! Go to Solution.
05-07-2010 12:27 PM
Hi Rus_K,
The 6251 only has 2 counters so you can't measure more than two channels at a time. However, you may sequentially measure the different channels on the two available counters. Any of the PFI lines on your 6251 should be able to be routed to the counters with a DAQmx Channel Property node:
The other APIs have similar properties that you can set to change the input terminal.
Best Regards,
05-07-2010 12:56 PM
You also might conceivably use change detection on digital port0, but you'd have a fairly intricate task to decode all the data to figure out the individual pulse widths. It's not so much really hard, just that the post-processing needs to pay a great deal of attention to detail.
If you go that route, you'd also need to setup a counter to buffer up the timestamps of "change detect events" so you would be able to correlate the samples collected in your DI task with the time represented by the samples in your counter task.
-Kevin P
05-07-2010 01:47 PM
Thank you John. I was playing with that option. Have one more question. Where do you put channel property, after Virtual channel.v?
Is the picture has corect order ?
Thank you
05-07-2010 02:11 PM
After the create virtual channel should be fine.
Also, if you want to change the input without restarting the entire program you can stop the task, call the channel property to change the channel, and restart the task.
The change detection is also a good idea, but it does get a bit complicated to efficiently program all of the logic required to compute the measurements in software. I've played around with the idea before but ran into some problems if the pulses came too close to one another on the respective lines.
Best Regards,