Sensoray526 Encoder Input

Sensoray526 Encoder Input block


Simulink® Real-Time™ Library for Sensoray

Block Parameters


From the list, select 1, 2, 3, or 4. This parameter specifies the encoder input channel that this block reads.

Index reset mode

From the list, choose one of the following. This is the event on the index input that resets the counter to the value of Reset value.

  • Rising edge on index

  • Falling edge on index

  • Both edges

  • None

Reset value

The reset value contains the value of the counter when the event that the Index reset mode parameter specifies occurs on the index input.

Initial value

The initial value vector contains the value that is initially loaded into the counter when model execution starts. The counter is set to the initial value between the time the model is downloaded and the time it is started.

Output range

This parameter controls the way the 24-bit integer count is converted to the double precision signal output. From the list, select

  • Signed +- 2^23 — If the block interprets the high order bit as a sign bit, the output takes values in the range -223 to (+223)-1.

  • Unsigned 0 -> 2^24-1 — If the block interprets the 24-bit counter as an unsigned quantity, the output is in the range 0 to (224)-1.

Count speed

From the list, select a counting mode. Choose one of the following:

  • 1x — If counting up, count on the rising edge of CLKA. If counting down, count on the falling edge of CLKA.

  • 2x — Count both edges of CLKA, up or down.

  • 4x — Count both edges of both CLKA and CLKB, up or down.

Refer to the board manufacturer documentation for details on the counting mode.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

Base address

Enter the base address of the board. This entry must correspond to the base address DIP switch settings on the board. For example, if the base address is 2C0 (hexadecimal), enter


Note that the Sensoray 526 board ships from the manufacturer with a base address of 0x2C0. If you want to change the base address, see the board manufacturer documentation for allowed values.

Was this topic helpful?