Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using counter in NI-6220

Hello:

 

I'm using NI PCIe-6220 DAQ on Ubuntu 17.20 with comedi driver. I'm trying to set it up to read one line TTL signal from an RPM sensor (ROS). Thus I have two questions:

  1. Does anyone have an example C code for this device using comedi driver?
  2. The specification for 6220 indicates that there are 6 inputs for a counter: A, Z, B, SRC, GATE, & AUX. What is the difference between them? If I just have one signal going up and down, where should it be connected?

Thank you.

0 Kudos
Message 1 of 2
(4,192 Views)

I know nothing about the comedi driver and what it does/doesn't support.  But I know general capabilities of the board from programming with LabVIEW on Windows using the DAQmx driver.

 

1. I'm no help for C code or the comedi driver.

2. Those 6 terminal labels don't map to distinct counter inputs at the hardware level.  One would mainly think in terms of signals labeled A,B, and Z when hooking up an incremental encoder because those are the signal names are in common use for encoders.

   The SRC signal is the one that will cause the count register to increment.  When you want to count edges, configure and edge-counting task and connect to the SRC terminal.

   GATE is tougher to pin down because it can serve different purposes.  I think of it as a kind of control input, but the nature of the control it exerts depends on other aspects of how the task is configured.  It could be a "pause trigger" (kind of an enable/disable on counting), a sample clock, or a trigger.   I'd guess that you want to measure the frequency of your RPM sensor; if so, you would configure a frequency measurement task and wire to the GATE terminal.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 2
(4,162 Views)