This function is used to perform the calculation of the difference between the two arguments, after reducing them to 32-bit entities of type fix.
Syntax |
real delta_enc32 (real actEnc, real oldEnc) |
---|---|
actEnc |
Contains the first unit (current value). (32-bit int format: range -2147483648-:-2147483647) |
oldEnc |
Contains the unit to subtract from the first (previous value). (32-bit int format: range -2147483648-:-2147483647) |
Result |
Returns the difference actEnc - oldEnc, modulated as if it were a 32-bit integer type variable |
Validity |
Rule, Task |
Note |
A typical example of the function's use is to construct a real quota based on an incremental encoder reading.
In the case of encoders, if actEnc is the current encoder reading and oldEnc is the reading taken in the previous sampling, the function returns the number of bits to which the encoder has moved in the period between the two readings.
Example of use:
|