Servo On and Off with MC_Power
MC_Power is used to power on a single servo axis. When Enable is ‘TRUE’, the servo will be powered on. When Enable is ‘FALSE’, the servo will be powered off.
-
Axis input must be a variable with the value of the axis to be controlled.
-
LS_Connect must be executed before this function block can be used to control an axis.
-
The following examples can be found in the XMC_SingleAxis_FBs.zip downloadable from Example Applications.
Element Name | Element Type | Description |
---|---|---|
Enable | Input | Level detected request to execute the function block. |
Axis | Input/Output | Axis reference variable.This can not be a constant. |
Status | Output | Indicates the status of axis power. |
Valid | Output | Indicates the validity of motion function block output. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
//Set Axis 1 reference
Axis1 := 1;
//Example MC_Power FB. Check that axis is ready
IF (_AX01_RDY) THEN
INST_MC_POWER(Enable:=Enable_Power,Axis:=Axis1,
ErrorID=>INST_MC_POWER.ErrorID);
END_IF;
LM501