Omron NY532-1500 User Manual page 314

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 absolute positioning are not set, the target values and other parameters are set.
IF InitFlag = FALSE THEN
// Parameters for MC_MoveAbsolute
Mv_Abs_Pos
Mv_Abs_Vel
Mv_Abs_Acc
Mv_Abs_Dec
Mv_Abs_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
Pwr_En:=TRUE;
ELSE
Pwr_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0, 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 0 and home is not defined, the MC_Home instruction is executed.
IF (Pwr_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm_Ex:=TRUE;
END_IF;
// After homing is completed for axis 0, absolute positioning is executed if it is not already in progress.
IF (Hm_D=TRUE)
AND (Mv_Abs_Act=FALSE) THEN
Mv_Abs_Ex := TRUE;
ELSE
Mv_Abs_Ex := FALSE;
END_IF;
// When ReExeSw changes to TRUE, the absolute positioning instruction is re-executed to change the target
position to 2000.
IF ReExeSw=TRUE THEN
Mv_Abs_Pos
Mv_Abs_Ex
END_IF;
//MC_Power
PWR(
Axis
Enable := Pwr_En,
Status
Busy
Error
ErrorID => Pwr_ErrID
10-38
:= LREAL#1000.0;
:= LREAL#500.0;
:= LREAL#500.0;
:= LREAL#500.0;
:= _eMC_DIRECTION#_mcPositiveDirection;
:=LREAL#2000.0;
:= TRUE;
:= MC_Axis000,
=> Pwr_Status,
=> Pwr_Bsy,
=> Pwr_Err,
NY-series Industrial Panel PC / Industrial Box PC Motion Control User's Manual (W559)

Advertisement

Table of Contents
loading

Table of Contents