| xPC Target™ | ![]() |
xPC Target Library for Incremental Encoder/Utilities
This block counts the number of times the output of an encoder block has rolled over. It counts up for positive direction rollovers and down for negative direction rollovers.
Enter the starting value you want the encoder block to begin with. Match this value to the value in the encoder mask.
Enter a rollover threshold value. To determine when a rollover has occurred, the model compares two consecutive encoder outputs and looks for a large jump. A large jump indicates a register overflow.
The threshold you enter defines a large jump. The smaller the threshold, the more likely the model will misinterpret a jump in successive encoder counts as a rollover. The larger the threshold, the more likely the model will not detect a rollover. Ideally, choose a number that is half the size of the register (for example, 2^(n-1)), where n is the size of the register in bits.
![]() | Extended Counter | Shared Memory Pack | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |