Omron NY532-1500 User Manual page 344

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
ST Programming
// If the input parameters for the motion instructions are not set, the target values and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction are set.
Vel_Vel
Vel_Acc
Vel_Dec
Vel_Dir
// The input parameters for the MC_Phasing (Shift Master Axis Phase) instruction are set.
Phasing_Ps
Phasing_Vel
Phasing_Acc
Phasing_Dec
// The input parameters for the MC_CamIn (Start Cam Operation) instruction are set.
Camin_Em
Camin_Sm
Camin_Sp
Camin_Msd
Camin_Ms
Camin_Ss
Camin_Mo
Camin_So
Camin_Rt
Camin_Dir
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 0.
IF (StartPg=TRUE)
AND (MC_Axis000.DrvStatus.Ready=TRUE) THEN
Pwr1_En:=TRUE;
ELSE
Pwr1_En:=FALSE;
END_IF;
// If the Servo Drive is ready when StartPg is TRUE, turn ON the Servo for axis 1.
IF (StartPg=TRUE)
AND (MC_Axis001.DrvStatus.Ready=TRUE) THEN
Pwr2_En:=TRUE;
ELSE
Pwr2_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 or axis 1, 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) 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 1 and home is not defined, the MC_Home instruction is executed for axis 1.
IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
10-68
:= LREAL#1000.0;
:= LREAL#100000.0;
:= LREAL#100000.0;
:= _eMC_DIRECTION#_mcPositiveDirection;
:= LREAL#500.0;
:= LREAL#1000.0;
:= LREAL#0.0;
:= LREAL#0.0;
:= TRUE;
:= _eMC_START_MODE#_mcRelativePosition;
:= LREAL#20.0;
:= LREAL#40.0;
:= LREAL#1.0;
:= LREAL#1.0;
:= LREAL#0.0;
:= LREAL#0.0;
:= _eMC_REFERENCE_TYPE#_mcCommand;
:= _eMC_DIRECTION#_mcNoDirection;
NY-series Industrial Panel PC / Industrial Box PC Motion Control User's Manual (W559)

Advertisement

Table of Contents
loading

Table of Contents