454
Programming Examples
Section 8-1
N008
Jumps to block N004 and repeats the above process 9 times.
N009
Initializes the X-axis’ position data to its original value.
N010
Increments the Y-axis’ position data by 30.
N011
Uses register E0 as a loop counter with an initial value of 0. The content of E0
is incremented by 1.
N012
Jumps to N004 as long as the content of E0 is not 5. When E0=5, N012 pro-
ceeds to the next block and ends the program.
Note
Register E0 is used as a loop counter in block N012 because loops cannot be
nested as shown below.
The loops in the example above will not operate properly. A subroutine can
also be used for nesting, as shown in the following programming example.
Programming Example 2
N000
P008
XY
N001
G11
N002
G63
A1000=100
N003
G63
A1001=100
N004
G72
P700
N005
G63
A1000=100
N006
G60
A1001=A1001+30
N007
G70
N004/L4
N008
G79
Subroutine
N000
P700
XY
N001
G01
XA1000 YA1001 F20 M10
N002
G01
X0
Y0
F50
N003
G60
A1000=A1000+20
N004
G70
N001/L9
N005
G73
Explanation
Blocks N005 through N008 in programming example 1 have been converted
to subroutine format in subroutine P700, which is called from step N004 in
main program P008. SUBROUTINE END (G73) is required at the end of the
P700.
N005
G01
XA1000 YA1001 F20 M10
:
:
N008
G70
N004/L10
:
:
N012
G70
N004/L5
Summary of Contents for CS1W-MC221 -
Page 1: ...Motion Control Units Cat No W359 E1 04 CS1W MC221 V1 421 V1 OPERATION MANUAL ...
Page 2: ...CS1W MC221 V1 421 V1 Motion Control Units Operation Manual Revised February 2008 ...
Page 3: ...iv ...
Page 5: ...vi ...
Page 11: ...xii ...
Page 15: ...xvi ...
Page 19: ...xx ...
Page 27: ...xxviii Conformance to EC Directives 6 ...
Page 133: ...106 Installation Section 2 2 2 2 4 Dimensions CS1W MC421 CS1W MC221 ...
Page 173: ...146 Connecting Peripheral Devices Section 2 7 ...
Page 227: ...200 Command Area Section 3 6 ...
Page 351: ...324 Interface Specifics Section 5 4 ...
Page 513: ...486 Absolute Encoder Interface Specifications Section 9 7 ...
Page 575: ...548 Error Log Section 12 6 ...
Page 589: ...562 Performance Appendix A ...
Page 655: ...628 Control Bit Flag Timing Charts Appendix E ...
Page 683: ...656 Origin Search Patterns Appendix F ...
Page 685: ...658 Encoder Divider Rate and Rotation Speed for OMRON Servo Drivers Appendix G ...