MC_SelectControlLoop
The function block MC_SelectControlLoop is used to switch between control loops of an axis. The prerequisite is that two or more control loops have been created below the axis in the system configuration.
[See detailed description of the control loop switching]
Inputs
VAR_INPUT
Execute : BOOL;
EncoderIndex : UINT;
SelectType : E_SelectControlLoopType;
SyncValue : LREAL;
ExtSetPointGen : BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
EncoderIndex | UINT | The sequential number [0..9] of the axis control loop to be activated. |
SelectType | Defines how the control loop switching is performed. Currently only applicable with the SelectControlLoopType_Standard value. | |
SyncValue | LREAL | Currently not applicable. |
ExtSetPointGen | BOOL | Currently not applicable. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | 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 supplies the error number. |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4024 | PC or CX (x86) | Tc2_MC2 |