10-41
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-11 I
nterr
upt F
eed
ing
This sample performs interrupt feeding when an interrupt occurs during velocity control. One of the fol-
lowing is specified for the
Direction
variable when velocity control is performed in Rotary Mode.
•
_mcPositiveDirection
•
_mcNegativeDirection
•
_mcCurrentDirection
This sample uses
_mcCurrentDirection
. A positive value is specified for the
FeedDistance
input variable
to perform feeding in the same direction as the motion before the interrupt input. A negative value is
specified for the
FeedDistance
input variable to perform feeding in the opposite direction as the motion
before the interrupt input. For example, if a positive value is specified for the
FeedDistance
input vari-
able when the motion was in the negative direction before the interrupt input, feeding is performed in
the negative direction. If a negative value is specified for the
FeedDistance
input variable, feeding is
performed in the positive direction.
10-2-11 Interrupt Feeding
Axis Parameter Settings
Parameter name
Setting
Description
Count Mode
Rotary Mode
Rotary Mode is set as the count mode for the position.
Modulo Maximum Position
Setting Value
360
The Modulo Maximum Position is set to 360.
Modulo Minimum Position
Setting Value
0
The Modulo Minimum Position is set to 0.
Homing Method
Zero position preset
A zero position preset is performed to define home.
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_Axis000.MFaultLvl.Active
BOOL
FALSE
TRUE when there is a minor fault level error
for axis 0.
MC_Axis000.Details.Homed
BOOL
FALSE
TRUE when home is defined for axis 0.
StartPg
BOOL
FALSE
When
StartPg
is TRUE, the Servo is turned
ON if EtherCAT process data communica-
tions are active and normal.
Pwr_Status
BOOL
FALSE
This variable is assigned to the
Status
output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
TrigRef
_sTRIGGER_REF
---
This parameter specifies the trigger input
condition to use for the interrupt input. Latch
1 of the Servo Drive is used in this sample.
Hm_Ex
BOOL
FALSE
This variable is used to execute the
MC_Home instruction. It is used in ST pro-
gramming.
Time
Velocity
Velocity control
Interrupt feeding
Содержание 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...