![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205338.webp)
10 Sample Programming
10-84
NJ-series CPU Unit Motion Control User’s Manual (W507)
Hm1_Ex:=TRUE;
END_IF;
// If the Servo is ON for axis 1 and home is not defined, the MC_Home instruction is executed for axis 1.
IF (Pwr2_Status=TRUE)
AND (MC_Axis001.Details.Homed=FALSE) THEN
Hm2_Ex:=TRUE;
END_IF;
// If
WriteCamData
is TRUE and a cam table file is not being saved, the values in the cam data variable are
changed.
// The displacements for phases of 0
°
to 180
°
are multiplied by 2 and the displacements for phases of 181
°
to 360
°
are multiplied by 0.5.
// When the changes are completed,
WriteDone
is changed to TRUE.
IF (WriteCamdata=TRUE)
AND (_MC_COM.Status.CamTableBusy=FALSE) THEN
FOR Index := UINT#10#0 TO UINT#10#360 DO
IF Index<UINT#10#180 THEN
CamProfile0[Index].Distance:=CamProfile0[Index].Distance*REAL#2.0;
ELSE
CamProfile0[Index].Distance:=CamProfile0[Index].Distance*REAL#0.5;
END_IF;
END_FOR;
WriteDone:=TRUE;
WriteCamdata:=FALSE;
END_IF;
// If homing is completed for axis 0, velocity control is executed.
IF Hm1_D=TRUE THEN
Vel_Ex:=TRUE;
END_IF;
// If the changes to the cam data variable are completed,
SaveCamtable
is TRUE, and a cam table file save opera-
tion is not in progress,
//
Sv_Cam_Ex
is changed to TRUE.
// If
Sv_Cam_Ex
is TRUE, the MC_SaveCamTable instruction is executed.
IF (WriteDone=TRUE)
AND (SaveCamtable=TRUE)
AND (_MC_COM.Status.CamTableBusy=FALSE) THEN
Sv_Cam_Ex := TRUE;
END_IF;
// If
Sv_Ca_TimeUp
is TRUE,
Sv_Cam_Ex
is changed to FALSE.
// If
Sv_Cam_Ex
is FALSE,
Sv_Ca_TimeUp
changes to FALSE and
Sv_Cam_Ex
changes to TRUE.
// The MC_SaveCamTable instruction is executed again.
IF (Sv_Cam_Ex=TRUE)
AND (Sv_Ca_TimeUp=FALSE) THEN
Sv_Cam_Ex := TRUE;
ELSE
Sv_Cam_Ex := FALSE;
END_IF;
// If Sv_Ca_CountUp is FALSE and a Cannot Execute Save Cam Table error occurs,
//
Sv_Cam_Disable
is changed to TRUE.
IF (Sv_Ca_CountUP=FALSE)
AND (Sv_Cam_Ca=TRUE) THEN
Sv_Cam_Disable := TRUE;
ELSE
Sv_Cam_Disable := FALSE;
END_IF;
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...