10-45
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-12 C
hanging the Ca
m T
ab
le b
y
R
e-e
x
ecution o
f an Instr
uctio
n
This sample changes the cam table during cam motion.
CamProfile0
is used when the command posi-
tion for axis 0 is 5000 or less and
CamProfile1
is used when it is over 5000.
* 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-12 Changing the Cam Table by Re-execution of an Instruction
Main Variables Used in the Programming Samples
Variable name
Data type
Default
Comment
MC_Axis000
_sAXIS_REF
---
This is the Axis Variable for axis 0.
MC_Axis001
_sAXIS_REF
---
This is the Axis Variable for axis 1.
CamProfile0
ARRAY[0..100] OF
_sMC_CAM_REF
---
This is the cam data variable.*
CamProfile1
ARRAY[0..10] OF
_sMC_CAM_REF
---
This is the cam data variable.*
Pwr1_S
BOOL
FALSE
This variable is assigned to the
Status
out-
put variable from the PWR1 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Pwr2_S
BOOL
FALSE
This variable is assigned to the
Status
out-
put variable from the PWR2 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
CamTable0
BOOL
FALSE
TRUE when
CamProfile0
is used for the
cam table.
CamTable1
BOOL
FALSE
TRUE when
CamProfile1
is used for the
cam table.
Camin_InCam0
BOOL
FALSE
This variable is assigned to the
InCam
out-
put variable from the CAMIN instance of the
MC_CamIn instruction. It is TRUE during
cam motion for
CamProfile0
. After this vari-
able changes to TRUE, it remains TRUE
until the operation is completed or canceled.
Camin_InCam1
BOOL
FALSE
This variable is assigned to the
InCam
out-
put variable from the CAMIN instance of the
MC_CamIn instruction. It is TRUE during
cam motion for
CamProfile1
. After this vari-
able changes to TRUE, it remains TRUE
until the operation is completed or canceled.
Mv_Abs_Act
BOOL
FALSE
This variable is assigned to the
Active
out-
put variable from the MV_ABS instance of
the MC_MoveAbsolute instruction.
Hm1_Ex
BOOL
FALSE
This variable is used to re-execute the
MC_Home instruction for axis 0.
Hm2_Ex
BOOL
FALSE
This variable is used to re-execute the
MC_Home instruction for axis 1.
Mv_Abs_Ex
BOOL
FALSE
This variable is used to execute the
MC_MoveAbsolute (Absolute Positioning)
instruction.
Camin_Ex
BOOL
FALSE
This variable is used to execute the
MC_CamIn (Start Cam) instruction. It is
used in ST programming.
StartPg
BOOL
FALSE
When
StartPg
is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
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...