Epson RC170 Guia do Utilizador Página 200

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 312
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 199
6. The SPEL+ Language
6.19 Using Traps
Traps are used to cause program execution to jump to a label or enable a function to be
called or executed as a task when a certain event occurs. Four traps are user defined and
are triggered by an input condition.
Note that Traps must be re-armed before they will fire again. To re-arm a trap, execute a
Trap statement at the end of the trap function.
You should keep trap functions short and avoid continuous loops. You cannot execute
motion commands in trap functions.
For details on Trap statement, see the SPEL+ Language Reference manual.
Here is a simple example for a trap. In this example, when input 1 turns on, the Sw1 Trap
function executes as a task.
Function main
' Arm the trap
Trap 1 Sw(1) = On Xqt Sw1Trap
Do
RunCycle
Loop
Fend
Function Sw1Trap
' Turn on output 1 for 2 seconds
On 1, 2
' Wait for trap condition to clear
Wait Sw(1) = Off
' Re-arm the trap
Trap 1 Sw(1) = On Xqt Sw1Trap
Fend
182 EPSON RC+ 5.0 (Ver.5.4) User's Guide Rev.4
Vista de página 199
1 2 ... 195 196 197 198 199 200 201 202 203 204 205 ... 311 312

Comentários a estes Manuais

Sem comentários