AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 1, the error handler for the device
(FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF MC_Axis000.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 1 and the Sensor1 bit is TRUE, the MC_MoveVelocity i
nstruction is executed.
IF (Pwr_Status=TRUE) AND (Sensor1=TRUE) THEN
Vel_Ex := TRUE;
END_IF;
// During execution of the MC_MoveVelocity instruction, the override factor is chan
ged according to the status of the Sensor2 and Sensor3 bits.
IF Vel_Act=TRUE THEN
IF (Sensor2=FALSE) AND (Sensor3=FALSE) THEN
Set_Ov_Velfct := LREAL#100.0;
ELSIF (Sensor2=TRUE) AND (Sensor3=FALSE) THEN
Set_Ov_Velfct := LREAL#500.0;
ELSIF (Sensor2=FALSE) AND (Sensor3=TRUE) THEN
Set_Ov_Velfct := LREAL#200.0;
ELSE
Set_Ov_Velfct := LREAL#200.0;
END_IF;
END_IF;
// The MC_SetOverride instruction is executed during velocity control for the MC_Mo
veVelocity instruction.
IF Vel_Act=TRUE THEN
Set_Ov_En := TRUE;
END_IF;
// The MC_Stop instruction is executed when StopTrig is TRUE.
IF StopTrig=TRUE THEN
Stp_Ex := TRUE;
END_IF;
// MC_Power
PWR(
Axis := MC_Axis000,
3 Axis Command Instructions
3-101
NY-series Motion Control Instructions Reference Manual (W561)
MC_MoveVelocity
3
Sample Programming