Generating Line Numbers; Writing A Program - Omron SYSMAC CV500-BSC11 Operation Manual

Basic units
Table of Contents

Advertisement

Writing and Entering Programs

4-2-5 Generating Line Numbers

4-2-6 Writing a Program

Generate line numbers automatically by using the AUTO command.
AUTO 100,5s
. . . . . . . . . . . . . . . . .
In this case, the program starts from line 100, and the line number is increm-
ented by 5.
The specification of increment can be omitted, in which case, the program line
number is incremented by 10.
AUTO 100s
. . . . . . . . . . . . . . . . . . .
Both the start line number and increment can be omitted, in which case, the pro-
gram with line number 10 is incremented by 10.
AUTOs
In this case, the following messages are displayed. Input the program below
these messages.
AUTO
Ok
10
To end generation of the line numbers, input CTRL+X, CTRL+C, or press carriage
return after the line numbers have been displayed.
Line numbers can also be manually input one at a time without using the AUTO
command.
Input and write the program along with line numbers. Each line must end with a
carriage return. A new line number will automatically be displayed. Continue in-
putting the program.
As an example, input the following program:
Key Input
PARACT 0s
A=3:B=4s
FOR I=1 TO 3s
A=A+Bs
PRINT As
NEXT Is
ENDs
END PARACTs
Program
10 PARACT 0
20 A = 3 : B = 4
30 FOR I = 1 TO 3
40 A = A + B
50 PRINT A
60 NEXT I
70 END
80 END PARACT
Input CTRL+X, CTRL+C, or press carriage return to end generation of the line
numbers.
Note The BASIC Unit is provided with a multitasking function by which more than one
task (program) can be processed in parallel. The programs in the BASIC Unit
should be written in units of tasks. PARACT 0 on line 10 in the above example
program is a command indicating the beginning of a task. A task can be num-
bered 0 to 15. END PARACT on line 80 indicates the end of a task. For further
information, refer to 6-2 Multitasking.
100 is the start line no. and 5 is the in-
crement.
100 is the start line no.
Section 4-2
63

Advertisement

Table of Contents
loading

Table of Contents