Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Read counter input channels by using NI PCI-6220

Hello,

 

I am using a NI PCI-6220 M Series DAQ Card on a Linux-Suse 10.0 Kernel 3.6.15 operating system to read the three TTL (0 or 5V) signals A, B and Z from an Odometer.

To read the Odometer-angle use the ansi-c programs, provided by NI.

 

PIN assignment:

 

A         37        PFI8                4096 increments

B         48        PFI10              increments 90 degrees phase-delayed

Z          3          PFI9               one increment per rotation

 

The position is measured on the counter’s A, B and Z input terminals. If I use the Example ANSI-C code from NI “AngularPosition-Buff-Cont.c”, carry the makefile out and start the program - nothing happens up to the timeout.

 

We measured the Odometer signal with an oscilloscop and they are ok and if we use this port like a normal counter it works, but not together with an odometer.

 

What can be wrong and that can be the solution for this problem.

 

 

 

Thanks for your help.

Rentsch

0 Kudos
Message 1 of 4
(3,985 Views)
Hi Rentsch,

if you are using buffered event counting, the counter is counting all the time, but don't write the data to the buffer.
You need a trigger signal, to tell the counter, when the counted events should be written to the buffer.

The Sample Clock Source determines when a sample will be inserted into the buffer.
In this example you use the signal to count as trigger signal for writting data to the buffer.
"DAQmxCfgSampClkTiming" is used to set this trigger intern.

If you use Samples to read = 1 and rate = 1 you will see directly the counting of the device.
"clockSource" should be PFI8 of your 6220.

Regards
Dippi

0 Kudos
Message 2 of 4
(3,965 Views)

Hello,

 

We want to buffer 150 increments from an Odometer with NI-PCI6220. The Odometer sends 3 TTL signals A, B and Z. We connect the Odometer with the PCI-6220 board on:

 

A-->PFI 8

B-->PFI  10

Z-->PFI  9

 

If we use the odometer in this configuration, it does not work.

But if I connect the odometer to the counter-pins, it works correctly.

 

How can we use the odometer in the buffered mode (150 Increments)? We need the direction information too. How does it work?

 

What is the right PIN assignment?

 

Is it possible to get an adapted C source code?

 

PFI 8 is the PIN for the source, which we know. How affect the B (course) and Z (one increment per rotaion) the function?

 

Thanks Rentsch

 

 

 

_______________________________________________________________________________________________

Re: Read counter input channels by using NI PCI-6220

Hi Rentsch,

if you are using buffered event counting, the counter is counting all the time, but don't write the data to the buffer.
You need a trigger signal, to tell the counter, when the counted events should be written to the buffer.

The Sample Clock Source determines when a sample will be inserted into the buffer.
In this example you use the signal to count as trigger signal for writting data to the buffer.
"DAQmxCfgSampClkTiming" is used to set this trigger intern.

If you use Samples to read = 1 and rate = 1 you will see directly the counting of the device.
"clockSource" should be PFI8 of your 6220.

Regards
Dippi

National Instruments
Technical Support

 

0 Kudos
Message 3 of 4
(3,940 Views)
Hi Rentsch,

please try to use Pin 45 for Line B and not Line 48.

See screenshot.

Regards
Dippi
0 Kudos
Message 4 of 4
(3,924 Views)