StickOS
DI-159 PLC Hardware Manual
Read/Data Statements
A program can declare read-only data in its code statements, and then consume the data at run-
time.
To declare the read-only data, use the data statement as many times as needed:
data
n
data
n
,
n
, ...
To consume data values and assign them to variables at runtime, use the read statement:
read
variable
read
variable
,
variable
, ...
If a read is attempted when no more data exists, the program stops with an "out of data" error.
A line may be labeled and the current data consumer pointer may be moved to a specific
(labeled) line with the statements:
label
label
restore
label
Examples
>
10 dim a, b
>
20 data 1, 2, 3
>
30 data 4
>
40 data 5, 6
>
50 data 7
>
60 while 1 do
>
70 read a, b
>
80 print a, b
>
90 endwhile
>
100 data 8
> run
1 2
3 4
5 6
7 8
out of data
STOP at line 70!
> _
49
Содержание DI-159
Страница 51: ...StickOS DI 159 PLC Hardware Manual 4 is even _ 51...
Страница 76: ...DI 159 Block Diagram 76...
Страница 77: ...Dimensional Drawing 77...