xPC Target    

CIO-QUAD04 Incremental Encoder

This driver block has three block outputs: Angle, Turns, and Init.

You can use Init to determine when the block output values are valid. Init is first set to 0. When the encoder reached the first index, Init is set to 1. From then on, you can determine the exact position, direction, and velocity. Init remains 1 unless Counter Reset by Index is set to First Only, and the counter detects a rollover. For more information, see Driver Block Parameters.

Turns is the number of complete revolutions made by the encoder. Angle is the amount the encoder turns since the last full revolution.

The distance is given by:

The velocity is given by:

The direction is given by:

A negative value is reverse, while a positive value is forward.

Driver Block Parameters

Function module -- From the list choose, 1, 2, 3, or 4. This parameter specifies which channel you use for this block. For the same board (same base address) two blocks cannot have the same channel number.

Counter Reset by Index -- From the list choose either Only First, or Continuous.

If you choose Only First, the first time the encoder reaches the index, the counter is reset to zero, the Init output signal is set to 1, and the encoder begins to count. The encoder ignores all other times it reaches the index. Init remains 1 until a rollover is detected, and then set to -1. A rollover is when the counter reaches its maximum value and begins to start counting at zero again. A rollover can also occur when the counter reaches its minimum value and the counter resets itself to the maximum value and resumes counting down. The outputs are still accurate after rollover. The -1 flag is used to alert that a rollover has occurred.

If you choose Continuous, The first time the encoder reaches the index, the counter is reset to zero, the Init output signal is set to 1, and the encoder begins to count. Each time the encoder reaches the index, it resets to zero. Init remains always at l because a rollover cannot occur.

Positive Rotation -- From the list, choose either Clockwise or Counter Clockwise. This parameter sets the direction for positive rotation. If you choose Clockwise, when the encoder is turned clockwise it counts up, and when turned counter clockwise it counts down. If you choose Counter Clockwise the counting direction is reversed.

Mode -- From the list, choose Single, Double, or Quadruple. This parameter specifies the phase detection mode. That is, how many phase changes are detected. For more information, see the board manual.

Resolution -- This field specifies the divisions of the connected incremental encoder for one revolution.


  CIO-QUAD04 PC104-DAC06 (/12)