Lenze PM94P01C Manual de usuario Pagina 94

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 134
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 93
PM94P01C92
Reference
Table 41: IF
IF IF/ENDIF Statement
Purpose
The IF statement tests for a condition and then executes the specific action(s) between the IF and
ENDIF statements if the condition is found to be true. If the condition is false, no action is taken and
the instructions following the ENDIF statement are executed. Optionally, using the ELSE statement, a
second series of statements may be specified to be executed if the condition is false.
Syntax
IF <condition>
{statements 1}
ELSE
{statements 2}
ENDIF
Remarks
See Also
WHILE, DO
Example:
IF APOS > 4 ;If actual position is greater than 4 units
V0=2
ELSE ;otherwise... (actual position equal or less than 4)
V0=0
ENDIF
;----------------------------------------------------------
If V1 <> V2 && V3>V4 ;If V1 doesn’t equal V2 AND V3 if greater than V4
V2=9
ENDIF
Table 42: JUMP
JUMP Jump to label from Event handler Statement
Purpose
This is a special purpose statement to be used only in the Event Handler code. When the EVENT is
triggered and this statement is processed, execution of the main program is transferred to the <label>
argument called out in the “JUMP” statement. The Jump statement is useful when there is a need for
the program’s flow to change based on some event(s). Transfer program execution to the instruction
following the label.
Syntax
JUMP <label>
<label> is any valid program label
Remarks
Can be used in EVENT handler only.
See Also
EVENT
Example:
EVENT ExternalFault INPUT IN_A4 RISE ;activate Event when IN_A4 goes high
JUMP ExecuteStop ;redirect program to <ExecuteStop>
ENDEVENT
StartMotion:
EVENT ExternalFault ON
ENABLE
MOVED 20
MOVED -100
{statements}
END
ExecuteStop:
STOP MOTION ;Motion stopped here
DISABLE ;drive disabled
Wait Until !IN_A4 ;Wait Until Input A4 goes low
GOTO StartMotion
Vista de pagina 93
1 2 ... 89 90 91 92 93 94 95 96 97 98 99 ... 133 134

Comentarios a estos manuales

Sin comentarios