MC_ReinitializeEncoder
The MC_ReinitializeEncoder function block is used to reinitialize the position of an encoder, similar to how it is initialized when TwinCAT restarts.
Inputs
VAR_INPUT
Execute : BOOL;
Options : ST_ReinitializeEncoderOptions;
END_VAR
Name | Type | Description |
|---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
Options | Data structure containing additional, rarely used parameters. The input can normally remain open. SelectEncoderIndex: can be set if an axis with several encoders is used and the position of a specific encoder is to be reinitialized (Options.EncoderIndex). EncoderIndex: indicates the encoder (0…n) if “SelectEncoderIndex” is TRUE. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VARName | Type | Description |
|---|---|---|
Axis | Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Name | Type | Description |
|---|---|---|
Done | BOOL | TRUE if the command was executed without errors. |
Busy | BOOL | TRUE as soon as the command is started with Execute and as long as the command is processed. If “Busy” is FALSE, the function block is ready for a new order. |
Error | BOOL | TRUE if an error occurs. |
ErrorID | UDINT | If the error output is set, this parameter provides the error number. |
Requirements
Development environment | Target platform | PLC library to include |
|---|---|---|
TwinCAT v3.1.4024.79 TwinCAT v3.1.4026
| PC or CX (x86) | Tc2_MC2 v3.3.75 |