INTRODUCTION
If you know how to program in any high level language, such as Basic or C, you
will be comfortable with Structured Text (ST) programming. ST programming is part of
the IEC 61131 standard. An example program is shown in Figure 19.1. The program is
called main and is defined between the statements PROGRAM and END_PROGRAM.
Every program begins with statements the define the variables. In this case the variable i is
defined to be an integer. The program follows the variable declarations. This program
counts from 0 to 10 with a loop. When the example program starts the value of integer
memory i will be set to zero. The REPEAT and END_REPEAT statements define the loop.
The UNTIL statement defines when the loop must end. A line is present to increment the
value of i for each loop.
ليست هناك تعليقات:
إرسال تعليق