DI-159 PLC Hardware Manual
StickOS
>
60 sub sumit numbers
>
70 dim a, sum
>
80 for a = 1 to numbers
>
90 let sum = sum+a
>
100 next
>
110 print "sum of integers 0 thru", numbers, "is", sum
>
120 endsub
>
run
sum of integers 0 thru 0 is 0
sum of integers 0 thru 1 is 1
sum of integers 0 thru 2 is 3
sum of integers 0 thru 3 is 6
sum of integers 0 thru 4 is 10
sum of integers 0 thru 5 is 15
sum of integers 0 thru 6 is 21
sum of integers 0 thru 7 is 28
sum of integers 0 thru 8 is 36
sum of integers 0 thru 9 is 45
>
new
>
10 dim a
>
20 print a
>
30 gosub increment a
>
40 gosub increment a
>
50 print a
>
60 end
>
70 sub increment value
>
80 let value = value+1
>
90 endsub
>
run
0
2
> _
56
Summary of Contents for DI-159
Page 51: ...StickOS DI 159 PLC Hardware Manual 4 is even _ 51...
Page 76: ...DI 159 Block Diagram 76...
Page 77: ...Dimensional Drawing 77...