LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

X4 Encoding

Hello, 

I am using Windows XP on Labview 8.

 

I was setting up a simple VI but when I clicked test on the DAQ Assist, the values only count up.

From what I understand, X4 (quadrature encoding) increments or decrements depending if channel A or B is leading.

On the encoder I am rotating the track clockwise(CW) and counterclockwise(CCW). If I rotate CW, the numbers should go up and CCW the numbers should go down. I would think channel A leads during CW and channel B during CCW. Am I thinking about this correctly?

 

Below are some screenshots and attached is the VI.

Any information is greatly appreciated.

 

Thank you,

SparkEE

 

Screenshot.PNG

 

VI Screenshot.PNG

0 Kudos
Message 1 of 8
(3,328 Views)

It should count up and down. I would double check the connections between the DAQ board and the encoder and try setting the acquisition mode to continuous and sample to read to 1. What hardware are you using?

 

Ben64

0 Kudos
Message 2 of 8
(3,304 Views)

I am using the PXI-6602 card with the SCB-68 connector block.

 

I called up NI and they said I would need two counters for 1 encoder but that doesn't seem right. An issue I run with that is that there can only be one counter in the DAQ assist. The connections are good, I've double and triple checked it because I thought maybe I just did it wrong Smiley Sad

0 Kudos
Message 3 of 8
(3,298 Views)

@SparkEE wrote:

I am using the PXI-6602 card with the SCB-68 connector block.

 

I called up NI and they said I would need two counters for 1 encoder but that doesn't seem right. An issue I run with that is that there can only be one counter in the DAQ assist. The connections are good, I've double and triple checked it because I thought maybe I just did it wrong Smiley Sad


No need for 2 counters. I'm using a quadrature encoder with an NI-9401 cdaq module and I defined the task in MAX with setting similar to yours (althought decoding type X1 and rate 50Hz) and it works fine. Are you sure you connected your signals to terminal 2 and 40 on the terminal block?

 

Ben64

0 Kudos
Message 4 of 8
(3,295 Views)

Hey Ben,

 

Yes I have channel A on pin 2 and channel B on pin 40.

What do you mean you defined the task in MAX? to try and simulate my parameters?

 

SparkEE

0 Kudos
Message 5 of 8
(3,290 Views)

@SparkEE wrote:

Hey Ben,

 

Yes I have channel A on pin 2 and channel B on pin 40.

What do you mean you defined the task in MAX? to try and simulate my parameters?

 

SparkEE


For a setup I've created a task in MAX called LLLT_LP using these settings:

 

ScreenShot019.png

 

When I press the run button and move the encoder shaft I observe value increase and decrease depending on the direction of the rotation. Thse settings are similar to the one you are using. So your settings seems to be ok and you are connected to the right pins of the PXI board.

 

Now are you sure you are connecting the good encoder wires (A and B, not Z)? Is your encoder damaged?

 

To check this you can create simple counter task with encoder A signal and verify if it's counting up, do the same thing with encoder signal B. If both are counting up then you are using the good wires and your encoder is probably not damage.

 

Side note: When you define a task in MAX you can run it in LabVIEW like this (simplified version):

read from encoder.png

 

Ben64

Message 6 of 8
(3,263 Views)

Hey Ben,

 

Since I am using Labview 8, when I create the simple task and choose continuous samples, it asks me what I want to use for a clock source.

I see that on your version it might be under advanced timing.

 

Thanks for helping out.

SparkEE

0 Kudos
Message 7 of 8
(3,242 Views)

I also verified that each signal counts up, which is good because the encoder works.

0 Kudos
Message 8 of 8
(3,236 Views)