Omron SYSMAC CS1G Operation Manual page 557

Motion control unit
Table of Contents

Advertisement

Program Example
Program 2
Explanation of the
program 2
534
Subprogram
01) A program No. and axes to be used are specified.
02) The task variable for counting (DL0002) is reset. (For [J01])
03) With FOR command, the process through 03) to 07) is repeated 10 times.
04) The axes [J01] and [J02] move based on the values in the position data
(PL0010) and (PL0011) respectively.
05) The axes return to the origin.
06) 1000 is added to the position data (PL0010) of [J01].
07) This is the end of FOR command from 03)
08) The subprogram is completed and the main program is resumed.
In the program above, the operations of [J01] and [J02] are repeated using the
main and subprograms, however, the same operation can be executed with
only one program. See the following program.
01) PROG P008 Q00000003;
02) STOPMODE;
03) #DW0000 = 0;
04) #PL0011 = 10000;
05) WHILE #DW0000 < 5;
06) #DL0002 = 0;
07) #PL0010 = 1000;
08) FOR W#DL0002 L10 S1;
09) MOVEL [J01]#PL0010 [J02]#PL0011 F300000;
10) MOVEL [J01]0 [J02]0;
11) #PL0010 = #PL0010 + 1000;
12) NEXT;
13) #DW0000 = #DW0000 + 1;
14) #PL0011 = #PL0011 + 5000;
15) WEND;
16) END;
01) A program No. and axes to be used are specified.
02) Stop Mode is selected.
03) The task variable for counting (DW0000) is reset. (For [J02])
04) The first travel distance of [J02] is entered into the position data (PL0011).
05) With WHILE command, the process through 05) to 15) is repeated until
the conditional expression is satisfied (repeated 5 times).
06) The task variable for counting (DL0002) is reset. (For [J01])
07) The first travel distance of [J01] is entered into the position data (PL0010).
08) With FOR command, the process through 08) to 12) is repeated 10 times.
09) The axes [J01] and [J02] move based on the values in the position data
(PL0010) and (PL0011) respectively.
10) The axes return to the origin.
11) 1000 is added to the position data (PL0010) of [J01].
12) This is the end of FOR command from 08).
13) 1 is added to the task variable for counting (DW0000) of [J02].
14) 5000 is added to the position data (PL0011) of [J02].
15) This is the end of WHILE command from 05).
16) The program is completed.
Section 10-1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cs1w-mch71Sysmac cs seriesSysmac cs1h

Table of Contents