Advertisement
Delfigamer

Untitled

May 16th, 2017
971
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "s_tankready" := "i_tanklevel":P >= 17632;
  2.  
  3. CASE "s_state" OF
  4.     "state_wait":
  5.         IF "i_athold" THEN
  6.             "s_state" := "state_incoming";
  7.         END_IF;
  8.     "state_incoming":
  9.         IF "s_statetimer" THEN
  10.             "s_targetlevel" := "i_tanklevel":P - "ui_leveldiff" * 44 / 5;
  11.             "s_state" := "state_fill";
  12.         END_IF;
  13.     "state_fill":
  14.         IF "i_tanklevel":P <= "s_targetlevel" THEN
  15.             "s_state" := "state_outgoing";
  16.             "s_bottlecount" := "s_bottlecount" + 1;
  17.         END_IF;
  18.     "state_outgoing":
  19.         IF "i_atend" THEN
  20.             "s_state" := "state_idle";
  21.         END_IF;
  22.     "state_idle":
  23.         IF "s_tankready" AND NOT "i_atend" THEN
  24.             "s_state" := "state_wait";
  25.         END_IF;
  26. END_CASE;
  27.  
  28. "IEC_Timer_0_DB".TON(IN:="s_state" = "state_incoming",
  29.                      PT:=T#1s,
  30.                      Q=>"s_statetimer");
  31.  
  32. "o_belt" := "s_state" <> "state_fill" AND "s_state" <> "state_idle";
  33. "o_hold" := "s_state" = "state_outgoing";
  34. "o_fill" := "s_state" = "state_fill" AND "i_athold";
  35. "o_supply" := "s_state" = "state_idle" AND NOT "s_tankready";
Advertisement
RAW Paste Data Copied
Advertisement