ROTATION_DIFFERENCE (FB)¶
FUNCTION_BLOCK ROTATION_DIFFERENCE
Computes the difference between two UINT values without rollover
This function block receives two values e.g. from an motion encoder and calculates the difference between the two positions.
If curValue := 65535 and lastValue := 15, a negative rotation is detected and diffValues := -16.
If lastValue := 65535 and curValue := 15, a positive rotation is detected and diffValues := 16.
- InOut:
Scope
Name
Type
Comment
Input
curValueUINTCurrent value of rotation
lastValueUINTLast value of rotation
Output
diffValuesINTDifference between the two values without rollover