Omron NJ501-1400 User Manual page 281

Machine automation controller nj series cpu unit motion control
Hide thumbs Also See for NJ501-1400:
Table of Contents

Advertisement

ST Programming
// If the input parameters for absolute linear interpolation and stopping the axes group are not set, the target values
and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveLinearAbsolute (Absolute Linear Interpolation) instruction are set.
Mv_Lin_Abs_Pos[0]
Mv_Lin_Abs_Pos[1]
Mv_Lin_Abs_Vel
Mv_Lin_Abs_Acc
Mv_Lin_Abs_Dec
Mv_Lin_Abs_Jrk
// The input parameters for the MC_GroupStop instruction are set.
Grp_Stp_Dec
Grp_Stp_Jrk
// The Input Parameter Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// When StartPg is TRUE, the Servo is turned ON for axis 0 if process data communications are active and normal.
// If process data communications are not active, the Servo is turned OFF.
IF (StartPg =TRUE)
AND (_EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]=FALSE) THEN
Pwr1_En:=TRUE ;
ELSE
Pwr1_En:=FALSE;
END_IF;
// When StartPg is TRUE, the Servo is turned ON for axis 1 if process data communications are active and normal.
// If process data communications are not active, the Servo is turned OFF.
IF (StartPg =TRUE)
AND (_EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress]=TRUE) THEN
Pwr2_En:=TRUE;
ELSE
Pwr2_En:=FALSE;
END_IF;
// If a minor fault level error occurs, the error handler for the device (FaultHandler) is executed.
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Group000.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;
END_IF;
NJ-series CPU Unit Motion Control User's Manual (W507)
:= LREAL#3000.0;
:= LREAL#3000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= LREAL#1000.0;
// Turn ON the Servo for axis 0.
// Turn OFF the Servo for axis 0.
// Turn ON the Servo for axis 1.
// Turn OFF the Servo for axis 1.
10 Sample Programming
10
10-27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1500

Table of Contents