LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware Timed Clock From Multiple Points

Hi All,

 

So I have attached a hardware timed data aquisition system that obtains a signal from the rise of a counter (from an encoder). The encoder is a quadrature encoder and therefore I have 3 more triggers that I could quadripple my resolution with the same hardware.

 

The current system is triggered off of the rise of the PFI37. I can use Rise-PFI37, Fall-PFI37, Rise-PFI39, and Fall-PFI39. How can I do this?

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

Hi bronco9588,

 

I was wondering, have you looked at the "Measure Angular Position" example VI which is made specifically to read quadrature encoders? It's located in LabVIEW at Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Counter Measurements>>Position. 

 

Regards,

Nathan S.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,061 Views)

Yup... checked it out. I fully understand how the encoder works and how that program works. I am using hardware timing whereas the examples are using continous samples. I have attached what I have so far. I am pretty happy with how things are turning out, but I just wish there was a way to stack clocks or something. I could always upgrade hardware, but why when the encoder has 4X the triggers, but not all in a happy package.

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

Since your code appears to expect to do quad encoder measurements and analog input on the same device, I'm

supposing that you're probably using either an M-series or X-series device.

 

If so, good news because both support digital change detection.  You may need to parallel wire your quad encoder

to the DIO inputs that support change detection, but you can then create a dummy DI task that samples based

on change detection of the A & B channels.  If you choose to be sensitive to both rising and falling edges of both

channels, you'll be able to generate a "Change Detect" hardware event with each quad encoder state transition.

 

You can config your encoder and analog tasks to use this "change detect" event as their sample clock to keep

them in sync.  I would try to be sensitive to the *trailing* edge of that event (likely a falling edge if I recall correctly)

to make sure the encoder position updates before the sample is taken.

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 4 of 4
(2,039 Views)