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 #381 background imageLoading...
Page #381 background image
10-75
10 Sample Programming
NJ/NX-series CPU Unit Motion Control User’s Manual (W507)
10-2 Basic Programming
Samples
10
10-2-15 Changing the Actual Position during Velocity Control
// If the input parameters for the instructions are not set, the target values and other parameters are set.
IF InitFlag=FALSE THEN
// The input parameters for the MC_MoveVelocity (Velocity Control) instruction are set.
Vel_Vel := LREAL#36.0;
Vel_Acc := LREAL#1000.0;
Vel_Dec := LREAL#1000.0;
Vel_Jrk := LREAL#100.0;
// The input parameters for the MC_SetPosition instruction are set.
Set_Pos_Pos := LREAL#0.0;
// 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 the Servo Drive is not ready, turn OFF the Servo.
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, velocity control is executed for axis 0.
IF Pwr_Status=TRUE THEN
Vel_Ex:=TRUE;
END_IF;
// If StartSetPos is TRUE while the Servo is ON, the Set Position instruction is executed.
IF (Pwr_Status=TRUE)
AND (StartSetPos=TRUE) THEN
Set_Pos_Ex:=TRUE;
END_IF;
//MC_Power
PWR(
Axis := MC_Axis000,
Enable := Pwr_En,
Status => Pwr_Status,
Busy => Pwr_Bsy,
Error => Pwr_Err,
ErrorID => Pwr_ErrID
);
//MC_MC_MoveVelocity
VEL(
Axis := MC_Axis000,
Execute := Vel_Ex,
Velocity := Vel_Vel,
Acceleration := Vel_Acc,
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