FB_CP22xx_Wheel
Implements the CP22xx_1025 specific incremental encoder including the 10-segment LED ring.
Syntax:
FUNCTION_BLOCK FB_CP22xx_Wheel EXTENDS FB_ScaleHmi
Properties
Name | Type | Access | Initial value | Description |
---|---|---|---|---|
Name | STRING | Get, Set | <SourceName> | Specifies the name of the class instance. |
FB_CP22xx_Wheel | ||||
Enc | I_CP22xx_WheelEnc | Get | THIS^ | Selective access to the encoder functions. |
FillMode | BOOL | Get, Set | FALSE | The LEDs fill up from |
GuidingMax | LREAL | Get, Set | 100.0 | Maximum value of the |
GuidingMid | LREAL | Get, Set | 0.0 | Value from which the LEDs fill. Only active with |
GuidingMidWindow | LREAL | Get, Set | 1.0 | Tolerance window in which the LEDs indicate a center position. Only active with |
GuidingMin | LREAL | Get, Set | 0.0 | Minimum value of the |
GuidingValue | LREAL | Get, Set | 0.0 | Control value for the LED display. |
Leds | I_CP22xx_WheelLed | Get | THIS^ | Selective access to the LED functions. |
LimitOverflow | BOOL | Get, Set | FALSE | Limits the current position to the limit values. The internal overflow is deleted directly. |
ModuloFactor | LREAL | Get, Set | 24.0 | Mask of the modulo position. By default, the factor is set to one revolution of the encoder. |
ModuloPos | LREAL | Get, Set | 0.0 | Modulo position |
Position | LREAL | Get | 0.0 | Current position of the encoder. |
PositionMax | LREAL | Get, Set | 0.0 | Maximum position of the encoder Only active with |
PositionMin | LREAL | Get, Set |
| Minimum position of the encoder. Only active with |
PositionOffset | LREAL | Get, Set | 0.0 | Position offset of the encoder . |
PositionRaw | UDINT | Get, Set | 0.0 | Raw position of the encoder. |
PositionScale | LREAL | Get, Set | 0.25 | Scaling factor of the encoder position. |
Press | Get | <Local> | Digital input from pressing the incremental encoder. | |
Velocity | LREAL | Get | 0.0 | Current velocity of the encoder (filtered). |
FB_Base | ||||
BaseState | Get | eNotHandled | Initialization state of the class instance. | |
Error | BOOL | Get | FALSE | Class is in an error state. |
ResultMessage | Get | - | Access to the class-internal EventLogger. | |
[ | STRING | Get | <SourceName> |
|
Methods
Name | Description |
---|---|
Reset() | Resets the error state of the class. |
FB_CP22xx_Wheel | |
SetPosition( | Sets the encoder position to the transferred position value. |
SetZero() | Sets the encoder position to 0. |
FB_ScaleHmi | |
[ | Scales a value |
FB_BaseHmi | |
Init( | Default initialization method to pass the base class. |
FB_Base | |
SetHMI( | General assignment method for an FB_BaseHmi extending class. |
[ | Extracts the first part of the instance path as an object namespace. |
[ | Extracts the last part of the instance path as the object name. |
Cycle methods
Name | Description |
---|---|
Cyclic() | Cycle method - Call once per PLC cycle (default 10 ms). |
Interfaces
Type | Description |
---|---|
I_Base | Standard interface on FB_Base. |
I_CP22xx_Wheel | Sum interface on FB_CP22xx_Wheel. |
I_CP22xx_WheelEnc | Encoder functions of the FB_CP22xx_Wheel. |
I_CP22xx_WheelLed | LED functions of the FB_CP22xx_Wheel. |
I_BaseHmi | Standard interface on FB_BaseHmi. |
I_BaseEmpty | For extension without standard interface. |
I_BaseDev | Covers all methods and properties of the base class. |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT >= v3.1.4024.54 (recommended) | PC or CX (x64, x86) | Tc3_PlasticBaseApplication (>= v3.12.7.0) |