Products & Services Industries Academia Support User Community Company

Learn more about xPC Target   

Extended Counter - Sample extended counter

Library

xPC Target Library for Incremental Encoder/Utilities

Description

This block outputs a count that is not bound by the number of bits on the board encoder counter register. It receives as input the output of an encoder block.

Block Parameters

Rollover Counts

Enter the number of rollover counts. This is the number at which the rollover occurs. This value should normally be 2^n, where n is the number of bits in the encoder counter register. Each rollover equals this number.

Encoder Starting Value

Enter the starting value with which the encoder block begins. This value should match the value in the encoder mask.

Rollover Threshold

Enter a rollover threshold value. This subsystem infers when a rollover occurs by comparing successive outputs from an encoder block. When the difference between outputs is extremely large, a rollover has occurred. Enter a value that is

  • Larger than the worst-case difference between successive outputs (to prevent declaring a rollover when it was just a large step)

  • Less than the maximum count value minus the worst-case difference (to prevent missing a rollover)

    Ideally, enter the value 2^(n-1), where n is the number of bits in the encoder counter register. The default is 2^15.

See Also

Rollover Counter

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS