10-91
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-18 U
pdating the Cam
T
ab
le End P
oint In
de
x
// The axis parameters are set. When setting the parameters is completed,
InitFlag
is changed to TRUE.
IF InitFlag=FALSE THEN
// The phases and displacements for null cam data are set.
PhaseData:=REAL#99.0;
DistanceData:=REAL#250.0;
// The Initialization Completed Flag is changed to TRUE.
InitFlag := TRUE;
END_IF;
// If a minor fault level error occurs in the MC Common Error Status Variable, the error handler for the device is
executed.
// Program the FaultHandler according to the device.
IF _MC_COM.MFaultLvl.Active=TRUE THEN
FaultHandler();
END_IF;
// If
StartPg
and
WriteCamData
are TRUE, the values in the cam data variable are changed.
// The phases and displacements are set in
CamProfile[100]
to
CamProfile[109]
.
// When the changes to the cam data variable are completed,
WriteDone
is changed to TRUE.
IF StartPg=TRUE
AND WriteCamData=TRUE THEN
FOR Index := UINT#10#100 TO UINT#10#109 DO
PhaseData
:=PhREAL#1.0;
DistanceData
:=DistaREAL#3.0;
CamProfile0[Index].Phase
:=PhaseData;
CamProfile0[Index].Distance
:=DistanceData;
END_FOR;
WriteDone:=TRUE;
END_IF;
// If the changes to the cam data variable are completed, the Set Cam Table Properties instruction is executed.
IF WriteDone=TRUE THEN
Set_Cam_Ex := TRUE;
END_IF;
//MC_SetCamTableProperty
SET_CAM(
CamTable
:= CamProfile0,
Execute
:= Set_Cam_Ex,
Done
=> Set_Cam_D,
EndPointIndex
=> Set_Cam_Epi,
MaxDataNumber
=> Set_Cam_Mdn,
Busy
=> Set_Cam_B,
CommandAborted
=> Set_Cam_Ca,
Error
=> Set_Cam_Err,
ErrorID
=> Set_Cam_ErrID
);
ST Programming
Set_Cam_B
Set_Cam_Ca
Set_Cam_Err
Set_Cam_ErrID
Set_Cam
_D
Done
Error
CommandAborted
CamTable
Busy
ErrorID
Execute
SET_CAM
MC_SetCamTableProperty
CamTable
CamProfile0
CamProfile0
Set_Cam_Mdn
MaxDataNumber
Set_Cam_Epi
EndPointIndex
WriteDone
If the changes to the cam data variable are completed, the Set Cam Table Properties instruction is executed.
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...