Drain Pumps Program-Example in LCE - Control of the 4-Pump System in the Drain Sewer

Top 



In the control program below, four suction pumps are turned on by rotation caster mode to deflation of the drain sewer.



plc
Drain_Pumps // Controls 4 pumps of the drain sewer, turned on by rotation caster mode, according to the level reached by the material in the drain, and in caster, to balanced depreciation of the ones by use in similar intensity. It permits detection of problems of operation or failures of start in the pumps, with consequent automatic adjust in the rotating of turning on of the pumps.

// Obs.: in the variables below, the cardinal 1, 2, 3 and 4 refer to pumps physically, but the ordinal 1ª (1st), 2ª (2nd), 3ª (3rd) and 4ª (4th) refer to pumps in the order in these ones will are turned on, which changes according to the cycle in that the system is operating (to implementation of the rotation caster), indicated by the value present in the variable Cycle:


// Cycle = 1: B1 - 1ª, B2 - 2ª, B3 - 3ª, B4 - 4ª

// Cycle = 2: B2 - 1ª, B3 - 2ª, B4 - 3ª, B1 - 4ª

// Cycle = 3: B3 - 1ª, B4 - 2ª, B1 - 3ª, B2 - 4ª

// Cycle = 4: B4 - 1ª, B1 - 2ª, B2 - 3ª, B3 - 4ª


// Each time that the drain is empty, the variable Cycle is changed: 1, 2, 3, 4, 1, 2, 3, ...


// After compilation, ascertain the virtual functioning selecting on menu: Virtual Plants -> Simulated Tanks of Liquids -> Turn SimuPLC On


var
I0.0   Turn_Off_Pumps,
   
I0.1
   Reset_Clocks,
   
I0.2
   Reset_Failures,

   
AIW0
Drain_Level,
   
I0.3
    Buoy_MaximumLevel,
   
I0.4
    Buoy_MinimumLevel,

   
Q0.1
   Pump1,
   
Q0.2
   Pump2,
   
Q0.3
   Pump3,
   
Q0.4
   Pump4,

   
I5.1
   FinalStart_B1,
   
I5.2
   FinalStart_B2,
   
I5.3
   FinalStart_B3,
   
I5.4
   FinalStart_B4,

   
M0.1
   Pump1ª_FinalStart,
   
M0.2
   Pump2ª_FinalStart,
   
M0.3
   Pump3ª_FinalStart,
   
M0.4
   Pump4ª_FinalStart,

   
I1.1
   Without_Failure1_B1,
   
I2.1
   Without_Failure2_B1,
   
I3.1
   Without_Failure3_B1,
   
I4.1
   Without_Failure4_B1,

   
I1.2
   Without_Failure1_B2,
   
I2.2
   Without_Failure2_B2,
   
I3.2
   Without_Failure3_B2,
   
I4.2
   Without_Failure4_B2,

   
I1.3
   Without_Failure1_B3,
   
I2.3
   Without_Failure2_B3,
   
I3.3
   Without_Failure3_B3,
   
I4.3
   Without_Failure4_B3,

   
I1.4
   Without_Failure1_B4,
   
I2.4
   Without_Failure2_B4,
   
I3.4
   Without_Failure3_B4,
   
I4.4
   Without_Failure4_B4,

   
T0
   TimeFunc_B1,
   
T1
   TimeFunc_B2,
   
T2
   TimeFunc_B3,
   
T3
   TimeFunc_B4,

   
AQW1
TimeFunc_B1_min,
   
AQW2
TimeFunc_B2_min,
   
AQW3
TimeFunc_B3_min,
   
AQW4
TimeFunc_B4_min,

   
Q1.1
   B1_Failure,
   
Q1.2
   B2_Failure,
   
Q1.3
   B3_Failure,
   
Q1.4
   B4_Failure,

   
M1.1
   Failure_B1ª,
   
M1.2
   Failure_B2ª,
   
M1.3
   Failure_B3ª,
   
M1.4
   Failure_B4ª,

   
VB0
   Cycle,
   
C0
Qtde_Resets_Time,

   
I7.0
   Simulate_Drain,
   
I7.1
   Simulate_FailureB1,
   
I7.2
   Simulate_FailureB2,
   
I7.3
   Simulate_FailureB3,
   
I7.4
   Simulate_FailureB4;

network
1 // Logic of turning off of the pumps, if drain is empty or if is operated the switch of general turning off, and control of the cycle of operation in rotation caster.

if
(Drain_Level <= 6400 or immediate Turn_Off_Pumps)
{
turn_off
immediate Pump1;
turn_off
immediate Pump2;
turn_off
immediate Pump3;
turn_off
immediate Pump4;

turn_off
Pump1ª_FinalStart;
turn_off
Pump2ª_FinalStart;
turn_off
Pump3ª_FinalStart;
turn_off
Pump4ª_FinalStart;

increment
B Cycle;    // Does var Cycle to vary from 1 to 4 alternately, turning on in
Cycle
B-:= (Cycle B/ 4) B* 4; // rotation caster every one of the pumps, avoiding that their              // operation times stay too much different along the time.
}

if
(Cycle = 0) { // If var Cycle was not initialized, set it to first
Cycle
B:= 1;
}

network
2 // Logic of rotation caster turning on of the pumps. Note that when the pump is turned on, this one only is turned off when the drain is completely empty (Drain_Level <= 6400).

if
( not immediate Turn_Off_Pumps and
(
Drain_Level
> 19200 or (Drain_Level > 6400 and Failure_B2ª and Failure_B3ª and Failure_B4ª)) )
{
if
( not Failure_B1ª) {
if
(Cycle = 1) {
turn_on
immediate Pump1;
}
if
(Cycle = 2) {
turn_on
immediate Pump2;
}
if
(Cycle = 3) {
turn_on
immediate Pump3;
}
if
(Cycle = 4) {
turn_on
immediate Pump4;
}
}
}

if
( not immediate Turn_Off_Pumps and
( (
Drain_Level
> 32000 and Pump1ª_FinalStart)
or
(Drain_Level > 19200 and Failure_B1ª)
or
(Drain_Level > 6400 and Failure_B1ª and Failure_B3ª and Failure_B4ª) ) )
{
if
( not Failure_B2ª) {
if
(Cycle = 1) {
turn_on
immediate Pump2;
}
if
(Cycle = 2) {
turn_on
immediate Pump3;
}
if
(Cycle = 3) {
turn_on
immediate Pump4;
}
if
(Cycle = 4) {
turn_on
immediate Pump1;
}
}
}

if
( not immediate Turn_Off_Pumps and
( (
Drain_Level
> 44800 and Pump2ª_FinalStart)
or
(Drain_Level > 19200 and Failure_B1ª and Failure_B2ª)
or
(Drain_Level > 32000 and (Failure_B1ª or Failure_B2ª))
or
(Drain_Level > 6400 and Failure_B1ª and Failure_B2ª and Failure_B4ª) ) )
{
if
( not Failure_B3ª) {
if
(Cycle = 1) {
turn_on
immediate Pump3;
}
if
(Cycle = 2) {
turn_on
immediate Pump4;
}
if
(Cycle = 3) {
turn_on
immediate Pump1;
}
if
(Cycle = 4) {
turn_on
immediate Pump2;
}
}
}

if
( not immediate Turn_Off_Pumps and
( (
Drain_Level
> 51200 and Pump3ª_FinalStart)
or
(Drain_Level > 19200 and Failure_B1ª and Failure_B2ª and Failure_B3ª)
or
(Drain_Level > 32000
and
( (Failure_B1ª and Failure_B2ª)
or
(Failure_B1ª and Failure_B3ª)
or
(Failure_B2ª and Failure_B3ª) ) )
or
(Drain_Level > 44800 and (Failure_B1ª or Failure_B2ª or Failure_B3ª))
or
(Drain_Level > 6400 and Failure_B1ª and Failure_B2ª and Failure_B3ª) ) )
{
if
( not Failure_B4ª) {
if
(Cycle = 1) {
turn_on
immediate Pump4;
}
if
(Cycle = 2) {
turn_on
immediate Pump1;
}
if
(Cycle = 3) {
turn_on
immediate Pump2;
}
if
(Cycle = 4) {
turn_on
immediate Pump3;
}
}
}

network
3 // Detects operating of the buoy security, when there is failure in the level sensor.

if
( Buoy_MaximumLevel ) {
Drain_Level
:= 64000;
}

if
( Buoy_MinimumLevel ) {
Drain_Level
:= 6400;
}

network
4 // Detects failures on anyone of the four pumps.

if
( not Without_Failure1_B1 or not Without_Failure2_B1 or not Without_Failure3_B1 or not Without_Failure4_B1 ) {
turn_off
immediate Pump1;
turn_on
immediate B1_Failure;

if
(Cycle = 1) {
turn_on
Failure_B1ª;
}
if
(Cycle = 2) {
turn_on
Failure_B2ª;
}
if
(Cycle = 3) {
turn_on
Failure_B3ª;
}
if
(Cycle = 4) {
turn_on
Failure_B4ª;
}
}

if
( not Without_Failure1_B2 or not Without_Failure2_B2 or not Without_Failure3_B2 or not Without_Failure4_B2 ) {
turn_off
immediate Pump2;
turn_on
immediate B2_Failure;

if
(Cycle = 1) {
turn_on
Failure_B4ª;
}
if
(Cycle = 2) {
turn_on
Failure_B1ª;
}
if
(Cycle = 3) {
turn_on
Failure_B2ª;
}
if
(Cycle = 4) {
turn_on
Failure_B3ª;
}
}

if
( not Without_Failure1_B3 or not Without_Failure2_B3 or not Without_Failure3_B3 or not Without_Failure4_B3 ) {
turn_off
immediate Pump3;
turn_on
immediate B3_Failure;

if
(Cycle = 1) {
turn_on
Failure_B3ª;
}
if
(Cycle = 2) {
turn_on
Failure_B4ª;
}
if
(Cycle = 3) {
turn_on
Failure_B1ª;
}
if
(Cycle = 4) {
turn_on
Failure_B2ª;
}
}

if
( not immediate Without_Failure1_B4 or not immediate Without_Failure2_B4 or not immediate Without_Failure3_B4 or not immediate Without_Failure4_B4 ) {
turn_off
immediate Pump4;
turn_on
immediate B4_Failure;

if
(Cycle = 1) {
turn_on
Failure_B2ª;
}
if
(Cycle = 2) {
turn_on
Failure_B3ª;
}
if
(Cycle = 3) {
turn_on
Failure_B4ª;
}
if
(Cycle = 4) {
turn_on
Failure_B1ª;
}
}

network
5 // Reset the failures after of corrective maintenances.

if
(Reset_Failures) {
turn_off
Failure_B1ª;
turn_off
Failure_B2ª;
turn_off
Failure_B3ª;
turn_off
Failure_B4ª;

turn_off
B1_Failure;
turn_off
B2_Failure;
turn_off
B3_Failure;
turn_off
B4_Failure;
}

network
6 // Clocks time of operation of the pumps (550 hours is approximately the maximum time that can be accumulated into our timers; when any pump reaches to this time, all the functioning times are zeroed and is initiated new temporization).

when
(immediate Pump1) temporize_accumulate TimeFunc_B1 550 h;
when
(immediate Pump2) temporize_accumulate TimeFunc_B2 550 h;
when
(immediate Pump3) temporize_accumulate TimeFunc_B3 550 h;
when
(immediate Pump4) temporize_accumulate TimeFunc_B4 550 h;

if
( not immediate Turn_Off_Pumps) {
// Converts times of operation of the pumps, from milliseconds to ...

// ... minutes, and shows it for purposes of operational control:


TimeFunc_B1_min
:= TimeFunc_B1 / 60000;
TimeFunc_B2_min
:= TimeFunc_B2 / 60000;
TimeFunc_B3_min
:= TimeFunc_B3 / 60000;
TimeFunc_B4_min
:= TimeFunc_B4 / 60000;
}

network
7 // Reset all var times of operation of the pumps to zero, when the command reset clocks is issued or is exceeded maximum temporization of any pump (maximum time allowed by the utilized equipment CLP; in the our simulator, 550 h)

if
(TimeFunc_B1 or TimeFunc_B2 or TimeFunc_B3 or TimeFunc_B4 or Reset_Clocks) {
reset
TimeFunc_B1;
reset
TimeFunc_B2;
reset
TimeFunc_B3;
reset
TimeFunc_B4;
}

count
(TimeFunc_B1 or TimeFunc_B2 or TimeFunc_B3 or TimeFunc_B4) reset_when (Reset_Clocks) in Qtde_Resets_Time reference 32000;

network
8 // Detects end of start of the pumps

if
(immediate FinalStart_B1) {
if
(Cycle = 1) {
turn_on
Pump1ª_FinalStart;
}
if
(Cycle = 2) {
turn_on
Pump2ª_FinalStart;
}
if
(Cycle = 3) {
turn_on
Pump3ª_FinalStart;
}
if
(Cycle = 4) {
turn_on
Pump4ª_FinalStart;
}
}

if
(immediate FinalStart_B2) {
if
(Cycle = 1) {
turn_on
Pump2ª_FinalStart;
}
if
(Cycle = 2) {
turn_on
Pump1ª_FinalStart;
}
if
(Cycle = 3) {
turn_on
Pump4ª_FinalStart;
}
if
(Cycle = 4) {
turn_on
Pump3ª_FinalStart;
}
}

if
(immediate FinalStart_B3) {
if
(Cycle = 1) {
turn_on
Pump3ª_FinalStart;
}
if
(Cycle = 2) {
turn_on
Pump2ª_FinalStart;
}
if
(Cycle = 3) {
turn_on
Pump1ª_FinalStart;
}
if
(Cycle = 4) {
turn_on
Pump4ª_FinalStart;
}
}

if
(immediate FinalStart_B4) {
if
(Cycle = 1) {
turn_on
Pump4ª_FinalStart;
}
if
(Cycle = 2) {
turn_on
Pump3ª_FinalStart;
}
if
(Cycle = 3) {
turn_on
Pump2ª_FinalStart;
}
if
(Cycle = 4) {
turn_on
Pump1ª_FinalStart;
}
}

end




As result of the compilation of the
Drain_Pumps program above, the SimuPLC 4.1.0 has generated, exactly, the following code, in Instruction List - IL:



// PLC    Drain_Pumps
// Controls 4 pumps of the drain sewer, turned on by rotation caster mode, according to the level reached by the material in the drain, and in caster, to balanced depreciation of the ones by use in similar intensity. It permits detection of problems of operation or failures of start in the pumps, with consequent automatic adjust in the rotating of turning on of the pumps.
// Obs.: in the variables below, the cardinal 1, 2, 3 and 4 refer to pumps physically, but the ordinal 1ª (1st), 2ª (2nd), 3ª (3rd) and 4ª (4th) refer to pumps in the order in these ones will are turned on, which changes according to the cycle in that the system is operating (to implementation of the rotation caster), indicated by the value present in the variable Cycle:
// Cycle = 1: B1 - 1ª, B2 - 2ª, B3 - 3ª, B4 - 4ª
// Cycle = 2: B2 - 1ª, B3 - 2ª, B4 - 3ª, B1 - 4ª
// Cycle = 3: B3 - 1ª, B4 - 2ª, B1 - 3ª, B2 - 4ª
// Cycle = 4: B4 - 1ª, B1 - 2ª, B2 - 3ª, B3 - 4ª
// Each time that the drain is empty, the variable Cycle is changed: 1, 2, 3, 4, 1, 2, 3, ...
// After compilation, ascertain the virtual functioning selecting on menu: Virtual Plants -> Simulated Tanks of Liquids -> Turn SimuPLC On

//
=VAR   I0.0   Turn_Off_Pumps
//
=VAR   I0.1   Reset_Clocks
//
=VAR   I0.2   Reset_Failures
//
=VAR   AIW0   Drain_Level
//
=VAR   I0.3   Buoy_MaximumLevel
//
=VAR   I0.4   Buoy_MinimumLevel
//
=VAR   Q0.1   Pump1
//
=VAR   Q0.2   Pump2
//
=VAR   Q0.3   Pump3
//
=VAR   Q0.4   Pump4
//
=VAR   I5.1   FinalStart_B1
//
=VAR   I5.2   FinalStart_B2
//
=VAR   I5.3   FinalStart_B3
//
=VAR   I5.4   FinalStart_B4
//
=VAR   M0.1   Pump1ª_FinalStart
//
=VAR   M0.2   Pump2ª_FinalStart
//
=VAR   M0.3   Pump3ª_FinalStart
//
=VAR   M0.4   Pump4ª_FinalStart
//
=VAR   I1.1   Without_Failure1_B1
//
=VAR   I2.1   Without_Failure2_B1
//
=VAR   I3.1   Without_Failure3_B1
//
=VAR   I4.1   Without_Failure4_B1
//
=VAR   I1.2   Without_Failure1_B2
//
=VAR   I2.2   Without_Failure2_B2
//
=VAR   I3.2   Without_Failure3_B2
//
=VAR   I4.2   Without_Failure4_B2
//
=VAR   I1.3   Without_Failure1_B3
//
=VAR   I2.3   Without_Failure2_B3
//
=VAR   I3.3   Without_Failure3_B3
//
=VAR   I4.3   Without_Failure4_B3
//
=VAR   I1.4   Without_Failure1_B4
//
=VAR   I2.4   Without_Failure2_B4
//
=VAR   I3.4   Without_Failure3_B4
//
=VAR   I4.4   Without_Failure4_B4
//
=VAR   T0   TimeFunc_B1
//
=VAR   T1   TimeFunc_B2
//
=VAR   T2   TimeFunc_B3
//
=VAR   T3   TimeFunc_B4
//
=VAR   AQW1   TimeFunc_B1_min
//
=VAR   AQW2   TimeFunc_B2_min
//
=VAR   AQW3   TimeFunc_B3_min
//
=VAR   AQW4   TimeFunc_B4_min
//
=VAR   Q1.1   B1_Failure
//
=VAR   Q1.2   B2_Failure
//
=VAR   Q1.3   B3_Failure
//
=VAR   Q1.4   B4_Failure
//
=VAR   M1.1   Failure_B1ª
//
=VAR   M1.2   Failure_B2ª
//
=VAR   M1.3   Failure_B3ª
//
=VAR   M1.4   Failure_B4ª
//
=VAR   VB0   Cycle
//
=VAR   C0   Qtde_Resets_Time
//
=VAR   I7.0   Simulate_Drain
//
=VAR   I7.1   Simulate_FailureB1
//
=VAR   I7.2   Simulate_FailureB2
//
=VAR   I7.3   Simulate_FailureB3
//
=VAR   I7.4   Simulate_FailureB4

NETWORK    1 // Logic of turning off of the pumps, if drain is empty or if is operated the switch of general turning off, and control of the cycle of operation in rotation caster.

LDD<=   AIW0,   6400
OI   I0.0
RI    Q0.1,   1
RI    Q0.2,   1
RI    Q0.3,   1
RI    Q0.4,   1
R   M0.1,   1
R   M0.2,   1
R   M0.3,   1
R   M0.4,   1
INCB   VB0
// Does var Cycle to vary from 1 to 4 alternately, turning on in
MOVB   VB0,   Ve1
/
I   4,   Ve1
*
I   4,   Ve1
-I   Ve1,   VB0
// rotation caster every one of the pumps, avoiding that their              // operation times stay too much different along the time.

LDD=   VB0,   0
// If var Cycle was not initialized, set it to first
MOVB    1,   VB0

NETWORK    2 // Logic of rotation caster turning on of the pumps. Note that when the pump is turned on, this one only is turned off when the drain is completely empty (Drain_Level <= 6400).

LDNI    I0.0

LDD>   AIW0,   19200

LDD>   AIW0,   6400
A    M1.2
A    M1.3
A    M1.4
OLD
ALD

LDN   M1.1
ALD
LPS

LDD=   VB0,   1
ALD
SI    Q0.1,   1
LRD

LDD=   VB0,   2
ALD
SI    Q0.2,   1
LRD

LDD=   VB0,   3
ALD
SI    Q0.3,   1
LPP

LDD=   VB0,   4
ALD
SI    Q0.4,   1

LDNI    I0.0

LDD>   AIW0,   32000
A    M0.1

LDD>   AIW0,   19200
A    M1.1
OLD

LDD>   AIW0,   6400
A    M1.1
A    M1.3
A    M1.4
OLD
ALD

LDN   M1.2
ALD
LPS

LDD=   VB0,   1
ALD
SI    Q0.2,   1
LRD

LDD=   VB0,   2
ALD
SI    Q0.3,   1
LRD

LDD=   VB0,   3
ALD
SI    Q0.4,   1
LPP

LDD=   VB0,   4
ALD
SI    Q0.1,   1

LDNI    I0.0

LDD>   AIW0,   44800
A    M0.2

LDD>   AIW0,   19200
A    M1.1
A    M1.2
OLD

LDD>   AIW0,   32000

LD   M1.1
O    M1.2
ALD
OLD

LDD>   AIW0,   6400
A    M1.1
A    M1.2
A    M1.4
OLD
ALD

LDN   M1.3
ALD
LPS

LDD=   VB0,   1
ALD
SI    Q0.3,   1
LRD

LDD=   VB0,   2
ALD
SI    Q0.4,   1
LRD

LDD=   VB0,   3
ALD
SI    Q0.1,   1
LPP

LDD=   VB0,   4
ALD
SI    Q0.2,   1

LDNI    I0.0

LDD>   AIW0,   51200
A    M0.3

LDD>   AIW0,   19200
A    M1.1
A    M1.2
A    M1.3
OLD

LDD>   AIW0,   32000

LD   M1.1
A    M1.2

LD   M1.1
A    M1.3
OLD

LD   M1.2
A    M1.3
OLD
ALD
OLD

LDD>   AIW0,   44800

LD   M1.1
O    M1.2
O    M1.3
ALD
OLD

LDD>   AIW0,   6400
A    M1.1
A    M1.2
A    M1.3
OLD
ALD

LDN   M1.4
ALD
LPS

LDD=   VB0,   1
ALD
SI    Q0.4,   1
LRD

LDD=   VB0,   2
ALD
SI    Q0.1,   1
LRD

LDD=   VB0,   3
ALD
SI    Q0.2,   1
LPP

LDD=   VB0,   4
ALD
SI    Q0.3,   1

NETWORK    3 // Detects operating of the buoy security, when there is failure in the level sensor.

LD   I0.3
MOVD   64000,   AIW0

LD   I0.4
MOVD   6400,   AIW0

NETWORK    4 // Detects failures on anyone of the four pumps.

LDN   I1.1
ON   I2.1
ON   I3.1
ON   I4.1
RI    Q0.1,   1
SI    Q1.1,   1
LPS

LDD=   VB0,   1
ALD
S   M1.1,   1
LRD

LDD=   VB0,   2
ALD
S   M1.2,   1
LRD

LDD=   VB0,   3
ALD
S   M1.3,   1
LPP

LDD=   VB0,   4
ALD
S   M1.4,   1

LDN   I1.2
ON   I2.2
ON   I3.2
ON   I4.2
RI    Q0.2,   1
SI    Q1.2,   1
LPS

LDD=   VB0,   1
ALD
S   M1.4,   1
LRD

LDD=   VB0,   2
ALD
S   M1.1,   1
LRD

LDD=   VB0,   3
ALD
S   M1.2,   1
LPP

LDD=   VB0,   4
ALD
S   M1.3,   1

LDN   I1.3
ON   I2.3
ON   I3.3
ON   I4.3
RI    Q0.3,   1
SI    Q1.3,   1
LPS

LDD=   VB0,   1
ALD
S   M1.3,   1
LRD

LDD=   VB0,   2
ALD
S   M1.4,   1
LRD

LDD=   VB0,   3
ALD
S   M1.1,   1
LPP

LDD=   VB0,   4
ALD
S   M1.2,   1

LDNI    I1.4
ONI    I2.4
ONI    I3.4
ONI    I4.4
RI    Q0.4,   1
SI    Q1.4,   1
LPS

LDD=   VB0,   1
ALD
S   M1.2,   1
LRD

LDD=   VB0,   2
ALD
S   M1.3,   1
LRD

LDD=   VB0,   3
ALD
S   M1.4,   1
LPP

LDD=   VB0,   4
ALD
S   M1.1,   1

NETWORK    5 // Reset the failures after of corrective maintenances.

LD   I0.2
R   M1.1,   1
R   M1.2,   1
R   M1.3,   1
R   M1.4,   1
R   Q1.1,   1
R   Q1.2,   1
R   Q1.3,   1
R   Q1.4,   1

NETWORK    6 // Clocks time of operation of the pumps (550 hours is approximately the maximum time that can be accumulated into our timers; when any pump reaches to this time, all the functioning times are zeroed and is initiated new temporization).

LDI   Q0.1
TONR   T0,   1980000000

LDI   Q0.2
TONR   T1,   1980000000

LDI   Q0.3
TONR   T2,   1980000000

LDI   Q0.4
TONR   T3,   1980000000

LDNI    I0.0
// Converts times of operation of the pumps, from milliseconds to ...
// ... minutes, and shows it for purposes of operational control:
MOVD   T0,   Ve1
/
D   60000,   Ve1
MOVD   Ve1,   AQW1
MOVD   T1,   Ve1
/
D   60000,   Ve1
MOVD   Ve1,   AQW2
MOVD   T2,   Ve1
/
D   60000,   Ve1
MOVD   Ve1,   AQW3
MOVD   T3,   Ve1
/
D   60000,   Ve1
MOVD   Ve1,   AQW4

NETWORK    7 // Reset all var times of operation of the pumps to zero, when the command reset clocks is issued or is exceeded maximum temporization of any pump (maximum time allowed by the utilized equipment CLP; in the our simulator, 550 h)

LD   T0
O    T1
O    T2
O    T3
O    I0.1
R   T0,   1
R   T1,   1
R   T2,   1
R   T3,   1

LD   T0
O    T1
O    T2
O    T3

LD   I0.1
CTU   C0,   32000

NETWORK    8 // Detects end of start of the pumps

LDI   I5.1
LPS

LDD=   VB0,   1
ALD
S   M0.1,   1
LRD

LDD=   VB0,   2
ALD
S   M0.2,   1
LRD

LDD=   VB0,   3
ALD
S   M0.3,   1
LPP

LDD=   VB0,   4
ALD
S   M0.4,   1

LDI   I5.2
LPS

LDD=   VB0,   1
ALD
S   M0.2,   1
LRD

LDD=   VB0,   2
ALD
S   M0.1,   1
LRD

LDD=   VB0,   3
ALD
S   M0.4,   1
LPP

LDD=   VB0,   4
ALD
S   M0.3,   1

LDI   I5.3
LPS

LDD=   VB0,   1
ALD
S   M0.3,   1
LRD

LDD=   VB0,   2
ALD
S   M0.2,   1
LRD

LDD=   VB0,   3
ALD
S   M0.1,   1
LPP

LDD=   VB0,   4
ALD
S   M0.4,   1

LDI   I5.4
LPS

LDD=   VB0,   1
ALD
S   M0.4,   1
LRD

LDD=   VB0,   2
ALD
S   M0.3,   1
LRD

LDD=   VB0,   3
ALD
S   M0.2,   1
LPP

LDD=   VB0,   4
ALD
S   M0.1,   1