10-13
10 Sample Programming
NJ-series CPU Unit Motion Control User’s Manual (W507)
10-2 Basic Pr
o
g
ram
m
in
g
Samples
10
10-2-4 Error Monitor
in
g and Error Re
setting
fo
r Multi-a
x
es Coordina
ted Oper
ation
// When
StartPg
is TRUE, the status of process data communications is checked to see if communications are
active and normal.
// The Servo is turned ON for axis 0 if process data communications for axis 0 are active and normal.
// If process data communications are not active, the Servo for axis 0 is turned OFF.
IF (StartPg =TRUE)
AND (_EC_PDSlavTbl[MC_Axis000.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis000.Cfg.NodeAddress]=FALSE) THEN
Pwr1_En:=TRUE;
// Turn ON the Servo for axis 0.
ELSE
Pwr1_En:=FALSE;
// Turn OFF the Servo for axis 0.
END_IF;
// When
StartPg
is TRUE, the status of process data communications is checked to see if communications are
active and normal.
// The Servo is turned ON for axis 1 if process data communications for axis 1 are active and normal.
// If process data communications are not active, the Servo for axis 1 is turned OFF.
IF (StartPg =TRUE)
AND (_EC_PDSlavTbl[MC_Axis001.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis001.Cfg.NodeAddress]=FALSE) THEN
Pwr2_En:=TRUE;
// Turn ON the Servo for axis 1.
ELSE
Pwr2_En:=FALSE;
// Turn OFF the Servo for axis 1.
END_IF;
// If there is a minor fault level error for a composition axis in the axes group.
// execute the error handler (FaultHandler).
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Group000.MFaultLvl.Active=TRUE) THEN
FaultHandler();
// Program the FaultHandler according to the device.
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed.
IF (Pwr1_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex:= TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed.
IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:= TRUE;
END_IF;
// If the axes group is disabled and home is defined for axis 0 and axis 1, the axes group is enabled.
IF (MC_Group000.Status.Disabled=TRUE)
AND (Hm1_D=TRUE) AND (Hm2_D=TRUE) THEN
Grp_En_Ex:= TRUE;
END_IF;
// If there is a minor fault level error for the axes group, the axes group is disabled.
IF MC_Group000.MFaultLvl.Active=TRUE THEN
Grp_Dis_Ex:=TRUE;
END_IF;
// If
ResetON
is TRUE (i.e., if the external button is ON) and the axes group is stopped, the error is reset.
IF (ResetON=TRUE)
AND (MC_Group000.Status.ErrorStop=TRUE)
AND (MC_Group000.Details.Idle=TRUE) THEN
Grp_Reset_Ex := TRUE;
END_IF;
ST Programming
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...