![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205339.webp)
10-85
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-16 C
hanging a Cam D
ata V
a
riab
le and Sa
ving the Ca
m T
ab
le
// One second after the Cannot Execute Save Cam Table error occurs,
Sv_Ca_TimeUp
is changed to TRUE.
// If
Sv_Ca_TimeUp
changes to TRUE,
Sv_Cam_Ex
is changed to FALSE.
Sv_Ca_TON(
In
:= Sv_Cam_Disable ,
PT
:= T#1s ,
Q
=> Sv_Ca_TimeUp
);
//
Sv_Ca_CountLoad
is changed to TRUE for one period when the cam table is saved.
// If
Sv_Ca_CountLoad
changes to TRUE, the retry counter is reset.
R_TRIG1(SaveCamtable, Sv_Ca_CountLoad);
// If a Cannot Execute Save Cam Table error occurs three times,
Sv_Ca_CountUP
is changed to TRUE.
// If
Sv_Ca_CountUP
changes to TRUE,
Sv_Cam_Disable
is changed to FALSE.
// Retry processing for the MC_SaveCamTable instruction is completed.
Sv_Ca_CTD(
CD
:= Sv_Cam_Disable ,
LOAD
:= Sv_Ca_CountLoad ,
PV
:= INT#3 ,
Q
=> Sv_Ca_CountUP
);
// If the changes to the cam data variable and saving the cam table are completed and axis 0 is at the target
velocity, the cam operation is executed.
IF (Vel_InVel=TRUE)
AND (WriteDone=TRUE)
AND (Sv_Cam_D=TRUE) THEN
Camin_Ex:=TRUE;
END_IF;
//MC_SaveCamTable
SV_CAM(
CamTable
:=CamProfile0,
Execute
:= Sv_Cam_Ex,
Done
=> Sv_Cam_D,
Busy
=> Sv_Cam_Bsy,
CommandAborted
=> Sv_Cam_Ca,
Error
=> Sv_Cam_Err,
ErrorID
=> Sv_Cam_ErrID
);
CAMIN(
Master
:= MC_Axis000,
Slave
:= MC_Axis001,
CamTable
:= CamProfile0,
Execute
:= Camin_Ex,
Periodic
:= Camin_Em,
StartMode
:= Camin_Sm,
StartPosition
:= Camin_Sp,
MasterStartDistance
:= Camin_Msd,
MasterScaling
:= Camin_Ms,
SlaveScaling
:= Camin_Ss,
MasterOffset
:= Camin_Mo,
SlaveOffset
:= Camin_So,
ReferenceType
:= Camin_Rt,
Direction
:= Camin_Dir,
InCam
=> Camin_InCam,
InSync
=> Camin_InSync,
EndOfProfile
=> Camin_Eop,
Index
=> Camin_Index,
Busy
=> Camin_Bsy,
Active
=> Camin_Act,
CommandAborted
=> Camin_Ca,
Содержание 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...