![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205274.webp)
10 Sample Programming
10-20
NJ-series CPU Unit Motion Control User’s Manual (W507)
In this sample, the MC_Stop instruction is executed to decelerate to a stop if an external button turns
ON during execution of the MC_MoveAbsolute (Absolute Positioning) instruction. If there is a minor fault
level error, the
CommandAborted
output variable from the MC_Stop instruction changes to TRUE. In
that case, the MC_ImmediateStop instruction is executed to stop immediately. If for any reason the
Error
output variable from the MC_Stop instruction changes to TRUE, the MC_ImmediateStop instruc-
tion is executed to stop immediately. If the MC_ImmediateStop instruction is executed, the axis status is
Error Deceleration Stopping.
Samples are provided for both ladder diagram and ST programming.
10-2-7 Stopping Axes during Single-axis Operation
Main Variables Used in the Programming Samples
Variable name
Data type
Default
Comment
MC_Axis000
_sAXIS_REF
---
This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active
BOOL
FALSE
TRUE when there is a minor fault level error for
axis 0.
MC_Axis000.Details.Homed
BOOL
FALSE
TRUE when home is defined for axis 0.
Pwr_Status
BOOL
FALSE
This variable is assigned to the
Status
output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Stp_Ca
BOOL
FALSE
This variable is assigned to the
Command-
Aborted
output variable from the STP instance
of the MC_Stop instruction.
Stp_Err
BOOL
FALSE
This variable is assigned to the
Error
output
variable from the STP instance of the MC_Stop
instruction.
StartPg
BOOL
FALSE
When
StartPg
is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
StopOn
BOOL
FALSE
This variable gives the status of the external
button that is used to stop. The MC_Stop
instruction is executed to stop the axis if this
variable is TRUE.
Ladder Diagram
StartPg
Lock
_EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress] _EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress
PWR
Error
Axis
Axis
Enable
Status
Busy
MC_Power
ErrorID
Lock
MC_Axis000
Pwr_Status
Pwr_Bsy
Pwr_Err
Pwr_ErrID
When
StartPg
is TRUE, the status of process data communications of axis 0 is checked to see if communications
are active and normal.
The Servo for axis 0 is turned ON if process data communications for axis 0 are active and normal.
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...