10-7
10 Sample Programming
NJ/NX-series CPU Unit Motion Control Userās Manual (W507)
10-2 Basic Programming
Samples
10
10-2-3 Error Monitoring and Error Resetting for Single-axis Operation and Synchronized Operation
You can monitor error status by monitoring the status of Axis Minor Fault Occurrence in the Axis Vari-
able. If a minor fault level error occurs in this sample, the Enable input variable for the MC_Power
instruction changes to FALSE to turn OFF the Servo. If the external button is ON and the command cur-
rent velocity is zero, the error is reset with the MC_Reset (Reset Axis Error) instruction. Samples are
provided for both ladder diagram and ST programming.
10-2-3 Error Monitoring and Error Resetting for Single-axis Operation
and Synchronized 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.Status.ErrorStop BOOL FALSE TRUE while there is a minor fault level error for
axis 0 and the axis is decelerating to a stop or
stopped.
MC_Axis000.Details.Idle BOOL FALSE TRUE when the command current velocity for
axis 0 is zero, except when waiting for in-posi-
tion state.
StartPg BOOL FALSE When StartPg is TRUE, the Servo is turned ON
if EtherCAT process data communications are
active and normal.
ResetON BOOL FALSE This variable gives the status of the external
button that is used to reset errors.
Ladder Diagram
MC_Axis000.MFaultLvl.Active
EN
FaultHandler
FaultHandler
StartPg
Lock0
MC_Axis000.DrvStatus.Ready
PWR
Error
Axis Axis
Enable Status
Busy
MC_Power
ErrorID
Lock0
MC_Axis000
Pwr_Status
Pwr_Bsy
Pwr_Err
Pwr_ErrID
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 the Servo Drive is ready, turn ON the Servo for axis 0.
Check if the Servo Drive is ready when StartPg is TRUE.