Omron NY532-1500 User Manual page 336

Ny-series ipc machine controller industrial panel pc / industrial box pc
Hide thumbs Also See for NY532-1500:
Table of Contents

Advertisement

10 Sample Programming
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 3.
IF (StartPg=TRUE)
AND (MC_Axis003.DrvStatus.Ready=TRUE) THEN
Pwr4_En:=TRUE;
ELSE
Pwr4_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 to axis 3, the error handler for the device (FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Axis002.MFaultLvl.Active=TRUE)
OR (MC_Axis003.MFaultLvl.Active=TRUE) THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed for axis 0.
IF (Pwr1_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex:=TRUE;
END_IF;
// If the Servo is ON for axis 3 and home is not defined, the MC_Home instruction is executed for axis 3.
IF (Pwr4_Status=TRUE)
AND (MC_Axis003.Details.Homed=FALSE) THEN
Hm4_Ex:=TRUE;
END_IF;
// If homing is completed for axis 0, velocity control is executed.
IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;
END_IF;
// When axis 0 reaches the target velocity, gear operation is executed.
IF Vel_InVel=TRUE THEN
Gearin_Ex := TRUE;
END_IF;
// When axis 0 reaches the target velocity, cam operation is executed.
IF Vel_InVel=TRUE THEN
Camin_Ex := TRUE;
END_IF;
// If both gear and cam operation are in progress, the Combine Axes instruction is executed.
IF (Gearin_Act=TRUE)
AND (Camin_Act=TRUE) THEN
Combine_Ex:=TRUE;
END_IF;
// MC_Power for axis 0
PWR1(
Axis
Enable := Pwr1_En,
Status
Busy
Error
ErrorID => Pwr1_ErrID
);
// MC_Power for axis 3
PWR4(
10-60
:= MC_Axis000,
=> Pwr1_Status,
=> Pwr1_Bsy,
=> Pwr1_Err,
NY-series Industrial Panel PC / Industrial Box PC Motion Control User's Manual (W559)

Advertisement

Table of Contents
loading

Table of Contents