EasyManuals Logo

Omron NX701-1 User Manual

Omron NX701-1
448 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #327 background imageLoading...
Page #327 background image
10-21
10 Sample Programming
NJ/NX-series CPU Unit Motion Control User’s Manual (W507)
10-2 Basic Programming
Samples
10
10-2-7 Stopping Axes during Single-axis Operation
// If the input parameters for absolute positioning and stopping 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 := LREAL#10000.0;
Mv_Abs_Vel := LREAL#500.0;
Mv_Abs_Acc := LREAL#500.0;
Mv_Abs_Dec := LREAL#500.0;
Mv_Abs_Dir := _eMC_DIRECTION#_mcPositiveDirection;
// The input parameters for the MC_Stop instruction are set.
Stp_Dec:=LREAL#5000.0;
// The input parameters for the MC_Immediate Stop instruction are set.
Imd_Stp_SM :=_eMC_STOP_MODE#_mcFreeRunStop;
// 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;
// If homing is completed, absolute positioning is executed.
IF Hm_D=TRUE THEN
Mv_Abs_Ex := TRUE;
END_IF;
// If StopOn is TRUE, stopping is executed.
IF StopOn=TRUE THEN
Stp_Ex:=TRUE;
END_IF;
// If the Error or CommandAborted output variable from the MC_Stop instruction changes to TRUE, the
MC_ImmediateStop instruction is executed to stop immediately.
IF (Stp_Err=TRUE)
OR (Stp_Ca=TRUE) THEN
Imd_Stp_Ex:=TRUE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
ST Programming

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron NX701-1 and is the answer not in the manual?

Omron NX701-1 Specifications

General IconGeneral
BrandOmron
ModelNX701-1
CategoryController
LanguageEnglish

Related product manuals