LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read synchronously two encoders in cDAQ9178

I  want to read two encoders connected to cDAQ 9178  (counter0 and conter1) via NI9401 module. My problem is  how to read synchronously these two encoders. I have Labview 2009.  Maybe somebody has any template with  the program  which could be useful for me.

0 Kudos
Message 1 of 2
(2,796 Views)

A quick google search led me to this example.

 

{LabVIEW}\FPGAWizard\PlugIns\Function\niRIOQuadCtr\Templates\Fpga\QuadratureCtr_X4.vi

 

I'm guessing you have to wrap the encoder boolean logic in a subvi and drop two of those subvis on your block diagram.

 

You could then, at some interval, take the position outputs from those algorithms and drop them in a target to host FIFO to get simultenous data.

 

Sorry, I just noticed you're using a CDAQ.

 

Here's a starting point. YOu have to add another similar channel to your task and use the N Chan 1 sample polymophic read

 

{LabVIEW}\examples\DAQmx\Counter Input\Counter - Read Encoder.vi

 

9401 doesn't have any counters. You're going to have to post process your data with some delay. See:

https://decibel.ni.com/content/docs/DOC-4170

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