Advertisement
tanfy88

Untitled

Mar 11th, 2018
2,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SCL 1.32 KB | None | 0 0
  1. #tempo_att := S_PEXT(T_NO := "timer_pulsante", S := "start_timer_pulsante",
  2.                      TV := #tempo_preimpostato, Q => "stato_timer_pulsante",
  3.                      R := "reset_timer_pulsante");
  4.  
  5. // salto alla successiva fase
  6. START:
  7. IF (((NOT #richiesta) AND ("pulsante_dx" AND "pulsante_sx")) AND #consenso) THEN
  8.     "reset_timer_pulsante" := 0;
  9.     "sequenza" := 1;
  10.     RETURN;
  11. END_IF;
  12.  
  13. // avvio del temporizzatore e attivazione del comando
  14. IF (((#richiesta AND (NOT ("pulsante_dx" AND "pulsante_sx")))
  15.     AND (NOT #consenso)) AND (NOT "stato_timer_pulsante")) THEN
  16.     "reset_timer_pulsante" := 0;
  17.     "start_timer_pulsante" := 1;
  18.     #consenso := 1;
  19.     RETURN;
  20. END_IF;
  21.  
  22. // arresto del temporizzatore
  23. IF ((#richiesta AND "stato_timer_pulsante") AND ("pulsante_dx"
  24.     AND "pulsante_sx")) THEN
  25.     "start_timer_pulsante" := 0;
  26.     "reset_timer_pulsante" := 1;
  27.     #richiesta := 0;
  28.     GOTO START;
  29. END_IF;
  30.  
  31. // test per avvenuto errore
  32. IF (((#richiesta AND (NOT "stato_timer_pulsante")) AND #consenso)
  33.     AND (NOT ("pulsante_dx" AND "pulsante_sx"))) THEN
  34.     #richiesta := 0;
  35.     #consenso := 0;
  36.     "pulsante_dx" := 0;
  37.     "pulsante_sx" := 0;
  38.     "start_timer_pulsante" := 0;
  39.     "reset_timer_pulsante" := 0;
  40.     "errore" := 'X';            //errore in emergenza nel consenso
  41.     RETURN;
  42. END_IF;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement