Rockwell-automation 1771-DB Basic Module User Manual - Series A Manual de usuario Pagina 58

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 167
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 57
Operating Functions
Chapter 5
5–21
Mode: RUN
Type: CONTROL
The DO – WHILE [rel expr] instruction provides a means of “loop
control” within a module program. The operation of this statement is
similar to the DO – UNTIL [rel expr] except that all statements
between the DO and the WHILE [rel expr] are executed as long as the
relational expression following the WHILE statement is true. You can
nest DO – WHILE and DO – UNTIL statements.
Examples:
SIMPLE DO-WHILE NESTED
DO-WHILE - DO-UNTIL
u10 DO u10 DO
u20 A=A+1 u20 PRINT A=A+1
u30 PRINT A u25 DO
u40 WHILE At4 u30 B=B+1
u50 PRINT “DONE” u40 A,B,A*B
u60 END u50 WHILE Btu3
uRUN u60 B=0
u70 UNTIL A=3
u80 END
uRUN
1 1 1 1
2 1 2 2
3 1 3 3
4 2 1 2
DONE 2 2 4
2 3 6
READY 3 1 3
u 3 2 6
3 3 9
READY
u
5.4.9
Statements: DO – WHILE
[rel expr] (continued)
Vista de pagina 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 166 167

Comentarios a estos manuales

Sin comentarios