![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205314.webp)
10 Sample Programming
10-60
NJ-series CPU Unit Motion Control User’s Manual (W507)
// If the input parameters for the motion 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#100.0;
Vel_Acc
:= LREAL#0.0;
Vel_Dec
:= LREAL#0.0;
Vel_Dir
:= _eMC_DIRECTION#_mcPositiveDirection;
// The input parameters for the MC_CamIn (Start Cam Operation) instruction are set.
Camin_Em
:= TRUE;
Camin_Sm
:= _eMC_START_MODE#_mcRelativePosition;
Camin_Sp
:= LREAL#20.0;
Camin_Msd
:= LREAL#40.0;
Camin_Ms
:= LREAL#1.0;
Camin_Ss
:= LREAL#1.0;
Camin_Mo
:= LREAL#0.0;
Camin_So
:= LREAL#0.0;
Camin_Rt
:= _eMC_REFERENCE_TYPE#_mcCommand;
Camin_Dir
:= _eMC_DIRECTION#_mcNoDirection;
// The input parameters for the MC_GearIn (Start Gear Operation) instruction are set.
Gearin_RatN
:= UINT#10#1;
Gearin_RatD
:= UINT#10#1;
Gearin_RefTyp
:= _eMC_REFERENCE_TYPE#_mcCommand;
Gearin_Acc
:= LREAL#0.0;
Gearin_Dec
:= LREAL#0.0;
// The input parameters for the MC_CombineAxes (Combine Axes) instruction are set.
Combine_Cm := _eMC_COMBINE_MODE#_mcAddAxes;
Combine_RefMas:=_eMC_REFERENCE_TYPE#_mcLatestCommand;
Combine_RefAux:=_eMC_REFERENCE_TYPE#_mcLatestCommand;
// 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 (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;
ST Programming
COMBINE
Combine_Bsy
Combine_Act
Combine_Ca
Combine_InComb
Auxiliary
Active
Busy
Master
InCombination
CommandAborted
Auxiliary
MC_CombineAxes
Master
MC_Axis001
Gearin_Act
Slave
Slave
MC_Axis003
CombineMode
eMC_COMBINE_MODE#_mcAddAxes
Execute
RatioNumeratorMaster
RatioDenominatorMaster
RatioNumeratorAuxiliary
RatioDenominatorAuxiliary
ReferenceTypeAuxiliary
eMC_REFERENCE_TYPE#_mcLatestCommand
ReferenceTypeMaster
eMC_REFERENCE_TYPE#_mcLatestCommand
BufferMode
Camin_Act
MC_Axis002
ErrorID
Error
Combine_Err
Combine_ErrID
If both gear and cam operation are in progress, the Combine Axes instruction is executed.
Summary of Contents for NJ501-1300
Page 12: ...Sections in this Manual 10 NJ series CPU Unit Motion Control User s Manual W507...
Page 18: ...16 NJ series CPU Unit Motion Control User s Manual W507 CONTENTS...
Page 22: ...Read and Understand this Manual 20 NJ series CPU Unit Motion Control User s Manual W507...
Page 34: ...Revision History 32 NJ series CPU Unit Motion Control User s Manual W507...
Page 86: ...3 Configuring Axes and Axes Groups 3 28 NJ series CPU Unit Motion Control User s Manual W507...
Page 122: ...5 Motion Control Parameters 5 24 NJ series CPU Unit Motion Control User s Manual W507...
Page 158: ...6 Motion Control Programming 6 36 NJ series CPU Unit Motion Control User s Manual W507...
Page 166: ...7 Manual Operation 7 8 NJ series CPU Unit Motion Control User s Manual W507...
Page 182: ...8 Homing 8 16 NJ series CPU Unit Motion Control User s Manual W507...
Page 346: ...10 Sample Programming 10 92 NJ series CPU Unit Motion Control User s Manual W507...
Page 422: ...Appendices A 18 NJ series CPU Unit Motion Control User s Manual W507...
Page 423: ...Index 1 NJ series CPU Unit Motion Control User s Manual W507 I Index...
Page 430: ...Index 8 NJ series CPU Unit Motion Control User s Manual W507 Index...