LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder edge counter using analog input

I have using an 9215A USB (4AI).
2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
I'm a beginner so I need some help to find out how to do.
 
BR
Johan
 
0 Kudos
Message 1 of 2
(2,889 Views)

the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.

first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.

second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines Smiley Wink

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 2
(2,875 Views)