508
System Configuration and Wiring
Section 11-2
7) Creating/Compiling/Saving MC Programs, Registering in Projects, and Saving
Projects
Creating the Program
Using CX-Motion, create the following MC program. For details on creating
programs, refer to the
CX-Motion Online Help
.
MC Program
N000
P001 XY
*001
SAMPLE PROGRAM
N002
G04 5
N003
G26 XY
N004
G11
N005
G01 X400 Y300 F30
N006
G01 X100 Y200 F10
N007
G01 X200 Y400 F30
N008
G026 XY
N009
G79
Program Contents
N000
Declares program number P001 and use of the X and Y axes.
*001
This is a comment.
N002
Waits five seconds.
N003
Returns the X and Y axes to their reference origins.
N004
Selects the stop mode for positioning.
N005
Moves to X400 Y300 at speed 30.
N006
Moves to X100 Y200 at speed 10.
N007
Moves to X200 Y400 at speed 30.
N008
Returns the X and Y axes to their reference origins.
N009
Ends the program.
Saving and Compiling the MC Program
Compiling
After creating the program and before transferring it to the MC Unit, compile it
and check that no errors are generated.
1,2,3...
1.
Select
File/Properties
.
2.
Select
CS1W-MC221
for the MC type, and click
OK
.
3.
Select
Tool/Compile
.
Saving
1,2,3...
1.
Select
File/Save as....
2.
After inputting a file name, click
Save
.
Registering in the Project
1,2,3...
1.
Click on the MC Unit that was added in
5) Creating Projects/Adding PLCs
(CPU Units
, and select
Edit/Add File
.
2.
Click on
Program
, and click on the file that was saved in
Saving
above.
The MC program will be registered in the project.
Saving the Project
Save the project before transferring system parameters and the MC program
to the MC Unit.
1,2,3...
1.
Click on the project in the project workspace, and then select
File/Save
project as....
2.
Input a file name, and then select
Save
.
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 ...