Updating The Cam Table End Point Index - Omron NJ501-1400 User Manual

Machine automation controller nj series cpu unit motion control
Hide thumbs Also See for NJ501-1400:
Table of Contents

Advertisement

10 Sample Programming

10-2-18 Updating the Cam Table End Point Index

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.
Main Variables Used in the Programming Samples
Variable name
CamProfile0
WriteCamdata
WriteDone
* 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.
Ladder Diagram
The axis parameters are set. When setting the parameters is completed, InitFlag is changed to TRUE.
InitFlag
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.
_MC_COM.MFaultLvl.Active
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.
StartPg
WriteCamData
10-90
Data type
ARRAY[0..109] OF
_sMC_CAM_REF
BOOL
BOOL
1
// The phases and displacements for null cam data are set.
2
PhaseData:=REAL#99.0;
3
DistanceData:=REAL#250.0;
4
// The Initialization Completed Flag is changed to TRUE.
5
InitFlag := TRUE;
FaultHandler
EN
FaultHandler
1
FOR Index := UINT#10#100 TO UINT#10#109 DO
2
PhaseData:=PhaseData+REAL#1.0;
3
DistanceData:=DistanceData+REAL#3.0;
4
CamProfile0[Index].Phase:=PhaseData;
5
CamProfile0[Index].Distance:=DistanceData;
6
END_FOR;
7
WriteDone:=TRUE;
Default
Comment
---
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.
FALSE
This variable is used to start changing the
cam data. It is changed to TRUE to start
editing.
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.
NJ-series CPU Unit Motion Control User's Manual (W507)

Advertisement

Table of Contents
loading

This manual is also suitable for:

Nj501-1300Nj501-1500

Table of Contents