Omron NY532-1500 User Manual page 308

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
// The input parameters for the MC_MoveAbsolute (Absolute Positioning) instruction are set.
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;
ELSE
Hm_Ex:=FALSE;
END_IF;
// If the Servo is ON and home is defined, absolute positioning is executed.
IF (Pwr_Status=TRUE)
AND (Hm_D=TRUE) THEN
Mv_Abs_Ex:=TRUE;
END_IF;
//MC_Power
PWR(
Axis
Enable := Pwr_En,
Status
Busy
Error
ErrorID => Pwr_ErrID
);
//MC_Home
HM(
Axis
Execute
Done
Busy
CommandAborted
Error
ErrorID
);
10-32
:= LREAL#50000.0;
:= LREAL#10000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= _eMC_DIRECTION#_mcShortestWay;
:= MC_Axis000,
=> Pwr_Status,
=> Pwr_Bsy,
=> Pwr_Err,
:= MC_Axis000,
:= Hm_Ex,
=> Hm_D,
=> Hm_Bsy,
=> Hm_Ca,
=> Hm_Err,
=> Hm_ErrID
NY-series Industrial Panel PC / Industrial Box PC Motion Control User's Manual (W559)

Advertisement

Table of Contents
loading

Table of Contents