10-61
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-13 U
s
ing a C
am Profile C
ur
v
e
to
Correct the Syn
c
Star
t P
osition
// When
StartPg
is TRUE, the Servo is turned ON for axis 3 if process data communications are active and normal.
IF (StartPg=TRUE)
AND (_EC_PDSlavTbl[MC_Axis003.Cfg.NodeAddress]=TRUE)
AND (_EC_CommErrTbl[MC_Axis003.Cfg.NodeAddress]=FALSE) THEN
Pwr4_En:=TRUE;
ELSE
Pwr4_En:=FALSE;
END_IF;
// If a minor fault level error occurs for axis 0 to axis 3, the error handler for the device (FaultHandler) is executed.
// Program the FaultHandler according to the device.
IF (MC_Axis000.MFaultLvl.Active=TRUE)
OR (MC_Axis001.MFaultLvl.Active=TRUE)
OR (MC_Axis002.MFaultLvl.Active=TRUE)
OR (MC_Axis003.MFaultLvl.Active=TRUE) THEN
FaultHandler();
END_IF;
// If the Servo is ON for axis 0 and home is not defined, the MC_Home instruction is executed for axis 0.
IF (Pwr1_Status=TRUE)
AND (MC_Axis000.Details.Homed=FALSE) THEN
Hm1_Ex:=TRUE;
END_IF;
// If the Servo is ON for axis 3 and home is not defined, the MC_Home instruction is executed for axis 3.
IF (Pwr4_Status=TRUE)
AND (MC_Axis003.Details.Homed=FALSE) THEN
Hm4_Ex:=TRUE;
END_IF;
// If homing is completed for axis 0, velocity control is executed.
IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;
END_IF;
// When axis 0 reaches the target velocity, gear operation is executed.
IF Vel_InVel=TRUE THEN
Gearin_Ex := TRUE;
END_IF;
// When axis 0 reaches the target velocity, cam operation is executed.
IF Vel_InVel=TRUE THEN
Camin_Ex := TRUE;
END_IF;
// If both gear and cam operation are in progress, the Combine Axes instruction is executed.
IF (Gearin_Act=TRUE)
AND (Camin_Act=TRUE) THEN
Combine_Ex:=TRUE;
END_IF;
// MC_Power for axis 0
PWR1(
Axis
:= MC_Axis000,
Enable := Pwr1_En,
Status
=> Pwr1_Status,
Busy
=> Pwr1_Bsy,
Error
=> Pwr1_Err,
ErrorID => Pwr1_ErrID
);
Содержание NJ501-1300
Страница 12: ...Sections in this Manual 10 NJ series CPU Unit Motion Control User s Manual W507...
Страница 18: ...16 NJ series CPU Unit Motion Control User s Manual W507 CONTENTS...
Страница 22: ...Read and Understand this Manual 20 NJ series CPU Unit Motion Control User s Manual W507...
Страница 34: ...Revision History 32 NJ series CPU Unit Motion Control User s Manual W507...
Страница 44: ...1 Introduction to the Motion Control Function Module 1 10 NJ series CPU Unit Motion Control User s Manual W507...
Страница 58: ...2 Motion Control Configuration and Principles 2 14 NJ series CPU Unit Motion Control User s Manual W507...
Страница 86: ...3 Configuring Axes and Axes Groups 3 28 NJ series CPU Unit Motion Control User s Manual W507...
Страница 98: ...4 Checking Wiring from the Sysmac Studio 4 12 NJ series CPU Unit Motion Control User s Manual W507...
Страница 122: ...5 Motion Control Parameters 5 24 NJ series CPU Unit Motion Control User s Manual W507...
Страница 158: ...6 Motion Control Programming 6 36 NJ series CPU Unit Motion Control User s Manual W507...
Страница 166: ...7 Manual Operation 7 8 NJ series CPU Unit Motion Control User s Manual W507...
Страница 182: ...8 Homing 8 16 NJ series CPU Unit Motion Control User s Manual W507...
Страница 346: ...10 Sample Programming 10 92 NJ series CPU Unit Motion Control User s Manual W507...
Страница 422: ...Appendices A 18 NJ series CPU Unit Motion Control User s Manual W507...
Страница 423: ...Index 1 NJ series CPU Unit Motion Control User s Manual W507 I Index...
Страница 430: ...Index 8 NJ series CPU Unit Motion Control User s Manual W507 Index...