Rockwell-automation Logix5000 Controllers Structured Text Programming Manual de usuario Pagina 22

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 40
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 21
22 Publication 1756-PM007D-EN-P - November 2012
Chapter 1 Program Structured Text
IF...THEN
Use IF…THEN to do something if or when specific conditions occur.
Operands:
Structured Text
Description:
The syntax is:
To use ELSIF or ELSE, follow these guidelines.
1. To select from several possible groups of statements, add one or more
ELSIF statements.
Each ELSIF represents an alternative path.
Specify as many ELSIF paths as you need.
The controller executes the first true IF or ELSIF and skips the rest
of the ELSIFs and the ELSE.
2. To do something when all of the IF or ELSIF conditions are false, add
an ELSE statement.
Operand Type Format Enter
bool_
expression
BOOL Tag
Expression
BOOL tag or expression that evaluates to
a BOOL value (BOOL expression)
IF bool_expression THEN
<statement>;
END_IF;
IF bool_expression1 THEN
<statement >;
Statements to execute when
bool_expression1 is true
.
.
.
Optional
ELSIF bool_expression2 THEN
<statement>;
Statements to execute when
bool_expression2 is true
.
.
.
Optional
ELSE
<statement>;
Statements to execute when
both expressions are false
.
.
.
END_IF;
Vista de pagina 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 39 40

Comentarios a estos manuales

Sin comentarios