LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase difference measurement

Hmmm... interesting.

Let me see if I can get a picture of the DAQ ports and have you help me figure out where to plug what. I have been using the DAQMX.vi in my program set to counter mode, but have had no luck using a second signal as a clock for the count. It just gives errors like "system attempted to aquire data before available" and such. Let me get some pictures up.

Matthew

0 Kudos
Message 11 of 15
(875 Views)

Are you really sure that your DAQ card has no auxilary line for the counter ? Which type of DAQ card are you using ? It would be more efficient - and easier - to solve this counting task by hardware rather than by software.

In this case, I would suggest to use 2 parallel DAQmx tasks (buffered position measurement and buffered AI). One every pulse of the encoder, the position and the torque are read and written to the buffers.

0 Kudos
Message 12 of 15
(870 Views)

Here is a picture of my DAQ board available ports. I currently use the CTR 0 and CTR 1 SOURCE for the signal 1 and 2 connections. I am not sure how to use DAQMX for setting the counter to work correctly (track angle and direction). Where should I be connecting the signals and how do I setup DAQMX? Thanks... this is the first time I have used digital signals in Labview (most projects for me are voltage signal analog based)... and I appreciate the help.

 

0 Kudos
Message 13 of 15
(869 Views)
Hello MatthewM,

Based on the image of the pinout you've attached, it looks like your using a DAQPad-601x device.  This device uses the STC chip, which does not directly support quadrature encoder measurements through a position measurement task in DAQmx.  However, you can still use a basic edge counting task to connect a two-phase quadrature encoder to your DAQPad.  You can control the counter direction (count up or count down) by enabling externally controlled counter direction in your DAQmx Task, and wiring the B phase of your encoder to digital line P0.6 for counter 0 (or digital line P0.7 for counter 1).  With externally controller count direction enabled, Counter 0 counts down when P0.6 is at logic low and counts up when it is at logic high.  More information, and an example program showing how to program this in DAQmx, can be found at the following links:

KB 37ID3JIO: Making a Position Measurement with an STC Board and NI-DAQmx

Example Program: Quadrature Encoder with E Series Devices Using NI-DAQmx.vi

Application Note: Using Quadrature Encoders with E Series DAQ Boards

Also, more information about externally controlling the count direction can be found in the Counter Timing Signals section of the E Series Help.

I hope this helps,

Travis G.
Applications Engineering
National Instruments
www.ni.com/support
0 Kudos
Message 14 of 15
(830 Views)

Thanks for the help. I will give this another try here soon.

Matthew

0 Kudos
Message 15 of 15
(815 Views)