10-24-2007 05:48 PM
10-30-2007 04:41 PM - edited 10-30-2007 04:41 PM
Hi Jaewon,
From what I understand, you are trying to use two angular quadrature encoders on an NI-ELVIS with a 6251 using LabVIEW. The issue arises because the B terminal for ctr0 is designated as RESERVED and is an output only line.
It is possible to assign the counter terminals to different lines. To do this, right click on your block diagram, then select and place Measurement I/O » NI-DAQmx » Channel Node. Place the channel node before the DAQmx Start Task.vi and wire the task and error terminals appropriately. Then left click on the channel node and select Counter Input » Position » B Input » Terminal. This is shown in the picture below. Change the terminal to be writable by right clicking on the channel node and selecting Change All To Write. Finally, create a terminal constant by right clicking on the input terminal to the CI.Encoder.BInputTerm property and selecting Create » Constant, then select choose one of the available PFI lines from the drop down list. This process can be used to change any of the counter terminals.
Please post back if you have any questions. Have a great day!
Message Edited by ryan_d on 10-30-2007 04:41 PM
10-30-2007 04:59 PM
10-31-2007 06:03 PM
Hi Jaewon,
It sounds like the channel node is not getting executed every time the task runs, since you say that it routes inconsistently. Is your channel node executing every time you run your task? Is it in a case statement or any other control structure? If you can, please post a screen shot of your code. Doing this will let me see exactly how you’ve configured the counter and will help me better understand why the signal is not routing correctly.
Also, can you try your counter application with another break out terminal to test that the signals are getting routed correctly? This will help me determine if NI-ELIVS or your DAQ card is the problem.
Thanks!
11-01-2007 11:31 AM
11-01-2007 11:34 AM
The picture quality is not so good.
I attach the original file.
Sincerely, Yours
Jaewon Choi
11-02-2007 04:56 PM
09-11-2010 02:56 AM
Hi there
I have the same problem,i run your cods and the counter is always incrementing ... even if i rotate the disk anticlockwise, and with Position control lab 2 from NI i can not run it .....
Also the Problem is that (channel A=PFI8) is incrementing both direction always incrementing
and channel B= PFI10 is always 0 .
Any idea??
Thanx
09-13-2010 12:12 PM - edited 09-13-2010 12:13 PM
Hi aswwwa-
By default, X4 decoding is chosen as the decoding type. This specifies that the counter will increment on the rising ir falling edge of either signal A or B. What you need is either X1 or X2 decoding. Here is an excerpt from the DAQmx Help:
Quadrature encoders, or angular encoders, cause two signals to pulse while a shaft in the encoder rotates. These signals are signal A (also called channel A) and signal B (also called channel B). Signal A and B are offset by 90°, which determines the direction the encoder moves. For instance, in a quadrature encoder, if signal A leads, the encoder rotates clockwise. If signal B leads, the encoder rotates counter clockwise.
Counters on M Series, C Series, NI-TIO devices support three types of decoding for quadrature encoders: X1, X2, and X4. With X1 decoding, when signal A leads signal B, the counter increments on the rising edge of signal A. When signal B leads signal A, the counter decrements on the falling edge of signal A.
With X2 decoding, the same behavior holds as with X1, except the counter increments and decrements on both rising and falling edges of signal A.
Similarly, with X4 decoding, the counter increments and decrements on both rising and falling edges of both signal A and signal B. X4 decoding is more sensitive to position, but is also more likely to provide an incorrect measurement if there is vibration in the encoder.
Many encoders also use z indexing for precise determination of a reference position.
I hope this information helps. Best of luck with your application!