
585
Program Example
Section 10-1
• The target position is to be specified within the range of 0 to 360 degrees.
Passing the position of 360 (0) degrees clears the present position to 0.
1,2,3...
1.
Enter a target position into the position data using IOWR instruction.
2.
Execute positioning by turning ON the general input for positioning.
3.
1 is output to the general output once positioning is completed.
4.
0 is output to the general output when the general input for positioning is
turned OFF.
5.
The process through 1 to 4 is repeated until the general input for repeat is
turned ON.
Program
Main program
01) PROG P011 Q00000001;
02) WHILE #IW0B00 <> 1;
03) WAIT #IW0B01 = = 1;
04) #PL0020 = #SL0206;
05) #PL0022 = #PL0000 - #PL0020;
06) GOSUB P502;
07) IF #PL0022 < -180;
08) #PL0002 = # 360;
09) #PL0022 = 360;
10) ENDIF;
11) IF #PL0022 < 180;
12) #PL0002 = #PL0022;
13) #PL0022 = 360;
14) ENDIF;
15) IF #PL0022 < 360;
16) #PL0002 = #PL0022 - 360;
17) ENDIF;
18) INC MOVEL [J01]#PL0002 F300000;
19) NOPS;
20) #OW0BA0 = 1;
21) WAIT #IW0B01 = = 0;
22) #OW0BA0 = 0;
23) WEND;
24) END;
Subprogram
01) PROG P502 Q00000000;
02) WHILE #PL0022 > = 360;
03) #PL0022 = #PL0022 - 360;
04) WEND;
05) RETURN;
0
°
360
°
60
°
120
°
180
°
Positioning with shorter distance
Summary of Contents for CS1W-MCH71 -
Page 2: ...CS1W MCH71 CJ1W MCH71 Motion Control Unit Operation Manual Revised June 2008 ...
Page 3: ...iv ...
Page 29: ...xxx ...
Page 33: ...xxxiv ...
Page 35: ...xxxvi ...
Page 39: ...xl ...
Page 69: ...24 Performance Section 1 7 ...
Page 99: ...54 Connecting MECHATROLINK Devices Section 3 5 ...
Page 283: ...238 Saving Data Section 5 4 ...
Page 417: ...372 Command Details Section 6 3 ...