nazihahz
in my ladder diagram in OpenPLC, i have 2 pump and 2 timer, when water level is low then threshold, pump A will On for 8 hours then after 8 hours pump A off and pump b will turn ON, if the water level still low. but if water level is low and pumpA is ON then suddenly the tank is full and it just only take 5 hours , and if the water level is low again so pump A will on, but i dont want to reset the timer i want to make it continue the timer which is the timer on pump A have balance 3 hours more
Reply 0 0
Grz
Hello nazihahz,
Perhaps you can use this POU.
Best regard
Pierre
Reply 0 0
thiagoralves
You can use the ET output of the timer to determine how much time is left. Then, you can move T#0s to the input PT of the timer to reset it, and then finally when it is time to turn it on again, you move the leftover time back to the timer's PT.
Reply 1 0
fg71
Here is example in Structured text using Function Block
 
[203128%2F9156128%2Fmceclip0]
 
Here is the Structured Text code for the Function Block
{__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)}

IF Start AND NOT TimerActive THEN
    TimerStartTime := CURRENT_TIME;
    TimerActive := TRUE;
END_IF;

IF Stop AND TimerActive THEN
    ElapsedTime := (CURRENT_TIME - TimerStartTime);
    TotalElapsedTime := (TotalElapsedTime + ElapsedTime);
    TimerActive := FALSE;
END_IF;

IF TimerActive THEN
    TimeElapsed := (CURRENT_TIME - TimerStartTime) + TotalElapsedTime;
ELSE
    TimeElapsed := ElapsedTime;
END_IF;

Active := TimerActive;
 
Reply 0 0
prof.giovanni
I would like to propose a solution in grafcet from which you can obtain the ladder or ST using a conversion technique that I use in my projects with the plc. I think it is useful to realize a solution with a state finite system before programming the plc in ladder or ST. today , i hope , i write a ladder solution
grafcet_pumpA_B.jpggrafcet_set_pumpA_B.jpg
Reply 0 0
nazihahz
Hello nazihahz,
Perhaps you can use this POU.
Best regard
Pierre
Thank you for helping me
Reply 0 0
nazihahz
You can use the ET output of the timer to determine how much time is left. Then, you can move T#0s to the input PT of the timer to reset it, and then finally when it is time to turn it on again, you move the leftover time back to the timer's PT.
Thank you for helping me
Reply 0 0
nazihahz
Here is example in Structured text using Function Block
 
[203128%2F9156128%2Fmceclip0]
 
Here is the Structured Text code for the Function Block
  1. {__SET_VAR(data__->,CURRENT_TIME,,__CURRENT_TIME)}
  2. IF Start AND NOT TimerActive THEN
  3.     TimerStartTime := CURRENT_TIME;
  4.     TimerActive := TRUE;
  5. END_IF;
  6. IF Stop AND TimerActive THEN
  7.     ElapsedTime := (CURRENT_TIME - TimerStartTime);
  8.     TotalElapsedTime := (TotalElapsedTime + ElapsedTime);
  9.     TimerActive := FALSE;
  10. END_IF;
  11. IF TimerActive THEN
  12.     TimeElapsed := (CURRENT_TIME - TimerStartTime) + TotalElapsedTime;
  13. ELSE
  14.     TimeElapsed := ElapsedTime;
  15. END_IF;
  16. Active := TimerActive;
 
Thank you for helping me
Reply 0 0
nazihahz
I would like to propose a solution in grafcet from which you can obtain the ladder or ST using a conversion technique that I use in my projects with the plc. I think it is useful to realize a solution with a state finite system before programming the plc in ladder or ST. today , i hope , i write a ladder solution
grafcet_pumpA_B.jpggrafcet_set_pumpA_B.jpg
Thank you for helping me
Reply 0 0
Reply