Omron NY532-1500 Reference Manual page 373

Ny-series industrial pc platform
Hide thumbs Also See for NY532-1500:
Table of Contents

Advertisement

Sample Programming
// Processing when input parameters are not set
IF InitFlag=FALSE THEN
// MC_MoveVelocity parameters
Vel_Vel
Vel_Acc
Vel_Dec := LREAL#0.0;
// MC_MoveLink parameters
Mv_Link_TrigRef.Mode
Mv_Link_TrigRef.LatchID
Mv_Link_TrigRef.InputDrive
Mv_Link_TrigVar
Mv_Link_SlvDis
Mv_Link_MasDis
Mv_Link_MasDisInAcc
Mv_Link_MasDisInDec
Mv_Link_LnkOpt
// Change InitFlag to TRUE after setting the input parameters.
InitFlag := TRUE;
END_IF;
// If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 1 is turned ON.
// If EtherCAT communications are not normal, 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;
// If StartPg is TRUE and EtherCAT communications are normal, the Servo for axis 2 is turned ON.
// If EtherCAT communications are not normal, the Servo is turned OFF.
IF (StartPg=TRUE)
AND (_EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress]=FALSE) THEN
Pwr2_En:=TRUE;
ELSE
Pwr2_En:=FALSE;
END_IF;
// Processing for a minor fault level error
// 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 1 and home is not defined, the Home instruction is executed.
IF (Pwr1_Status=TRUE) AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex:=TRUE;
END_IF;
// If the Servo is ON for axis 2 and home is not defined, the Home instruction is executed.
IF (Pwr2_Status=TRUE) AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
END_IF;
// After home is defined for axis 1, MC_MoveVelocity is executed for axis 1.
IF MC_Axis000.Details.Homed=TRUE THEN
Vel_Ex:=TRUE;
NY-series Motion Control Instructions Reference Manual (W561)
:= LREAL#1000.0;
:= LREAL#0.0;
:= _eMC_TRIGGER_MODE#_mcDrive;
:= _eMC_TRIGGER_LATCH_ID#_mcLatch1;
:= _eMC_TRIGGER_INPUT_DRIVE#_mcEXT;
:= FALSE;
:= LREAL#1000.0;
:= LREAL#1000.0;
:= LREAL#100.0;
:= LREAL#100.0;
:= _eMC_LINKOPTION#_mcTriggerDetection;
// Turn ON the Servo for axis 1.
// Turn OFF the Servo for axis 1.
// Turn ON the Servo for axis 2.
// Turn OFF the Servo for axis 2.
3 Axis Command Instructions
3
3-289

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ny512-1500Ny532-1400Ny512-1400Ny512-1300Ny532-1300

Table of Contents