![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205344.webp)
10 Sample Programming
10-90
NJ-series CPU Unit Motion Control User’s Manual (W507)
This sample increases the valid number of data points by 10 in a cam table with a maximum number of
data points of 110 and a valid number of data points of 100. It also updates the end point index.
* The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to
109 in this sample.
10-2-18 Updating the Cam Table End Point Index
Main Variables Used in the Programming Samples
Variable name
Data type
Default
Comment
CamProfile0
ARRAY[0..109] OF
_sMC_CAM_REF
---
This is a cam data variable with a maximum
number of data points of 110.* It contains
100 valid cam data points and 10 null cam
data points.
WriteCamdata
BOOL
FALSE
This variable is used to start changing the
cam data. It is changed to TRUE to start
editing.
WriteDone
BOOL
FALSE
This variable is used to indicate when the
changes to the cam data are completed. It
changes to TRUE when the changes to the
cam data are completed.
Ladder Diagram
InitFlag
1
2
3
4
5
StartPg
1
2
3
4
5
6
7
WriteCamData
_MC_COM.MFaultLvl.Active
EN
FaultHandler
FaultHandler
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;
If a minor fault level error occurs in the MC Common Error Status Variable, the error handler for the device
(FaultHandler) is executed. Program the FaultHandler according to the device.
// 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;
The axis parameters are set. When setting the parameters is completed,
InitFlag
is changed to TRUE.
If
StartPg
and
WriteCamData
are TRUE, the values in the cam data variable are changed.
Phases and displacements are set for
CamProfile[100]
to
CamProfile[109].
When the changes to the cam data variable are completed,
WriteDone
is changed to TRUE.
Содержание 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...