Advertisement
tanfy88

Untitled

Mar 11th, 2018
2,406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SCL 1.45 KB | None | 0 0
  1. #tempo_att := S_PEXT(T_NO := "timer_ganasce", S := "start_timer_ganasce",
  2.                      TV := #tempo_preimpostato, Q => "stato_timer_ganasce",
  3.                      R := "reset_timer_ganasce");
  4.  
  5. // salto alla successiva fase
  6. IF ((#richiesta_chiusura AND ((NOT "sensore_ganasce_aperte" ) AND
  7.     "sensore_ganasce_chiuse")) AND (NOT "occupato")) THEN
  8.     "reset_timer_ganasce" := 0;
  9.     "sequenza" := 3;
  10.     RETURN;
  11. END_IF;
  12.  
  13. // avvio del temporizzatore e attivazione del comando
  14. IF ((((#richiesta_chiusura AND (NOT "sensore_ganasce_chiuse")) AND
  15.     (NOT "comando_valv_ganasce")) AND (NOT "occupato")) AND
  16.     (NOT "stato_timer_ganasce")) THEN
  17.     "reset_timer_ganasce" := 0;
  18.     "comando_valv_ganasce" := 1;    // chiusura ganasce
  19.     "occupato" := 1;
  20.     "start_timer_ganasce" := 1;
  21.     RETURN;
  22. END_IF;
  23.  
  24. // arresto del temporizzatore
  25. IF (((#richiesta_chiusura AND "stato_timer_ganasce") AND "occupato") AND
  26.     ("sensore_ganasce_chiuse" AND (NOT "sensore_ganasce_aperte"))) THEN
  27.     "reset_timer_ganasce" := 1;
  28.     "start_timer_ganasce" := 0;
  29.     "occupato" := 0;
  30.     RETURN;
  31. END_IF;
  32.  
  33. // test per avvenuto errore
  34. IF ((((#richiesta_chiusura AND (NOT "stato_timer_ganasce")) AND
  35.     "comando_valv_ganasce") AND (NOT "sensore_ganasce_chiuse")) AND
  36.     "occupato") THEN
  37.     "comando_valv_ganasce" := 0;
  38.     "occupato" := 0;
  39.     "start_timer_ganasce" := 0;
  40.     "errore" := 'C';                //errore in Chiusura ganasce
  41.     RETURN;
  42. END_IF;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement