Draft of Automatic Control of the 3-Floor Elevator

Top 



In the control program below, draft of an automatic control of an elevator within building with 3 floors.



plc
Three_Floor_Elevator // Draft of automatic control of an elevator within building with 3 floors. (Attention: controls that concern directly to human life, like into elevators, boilers, oil pipelines, vehicles, etc., that can take it in risk in the case of bad operation, should be implemented in the real world with special rigor, beyond to have that to attend specific legislation, very rigorous tests, sanction by certificating departments, etc. Normally they are acquired into software package embedded in the controlled equipments. The present control here sketchy has features merely of exemplification and introduction to the study of the interesting and complex field of the elevators controls and related PLC-based ones.)

var   I0.0   call2ndFloor,
   
I0.1   callUp1stFloor,
   
I0.2   callDown1stFloor,
   
I0.3   callLower,

   
I0.4   doorOpen2ndFloor,
   
I0.5   doorOpen1stFloor,
   
I0.6   doorOpenLower,

   
I0.7   cabinClosed,
   
I1.0   cabinOpen,
   
T0   timeMinOpenLower,
   
T1   timeMinOpen1stFloor,
   
T2   timeMinOpen2ndFloor,

   
I1.1   buttonCab2ndFloor,
   
I1.2   buttonCab1stFloor,
   
I1.3   buttonCabLower,

   
I1.4   cabinIs2ndFloor,
   
I1.5   cabinIs1stFloor,
   
I1.6   cabinIsLower,

   
I1.7   Photocell,
   
I2.0   obstacleDoor,

   
Q0.0   motorUpCabin,
   
Q0.1   motorDownCabin,

   
Q0.2   motorOpenCabin,
   
Q0.3   motorCloseCabin,

   
Q0.4   unlockDoor2ndFloor,
   
Q0.5   unlockDoor1stFloor,
   
Q0.6   unlockDoorLower,
   
Q0.7   VentilaIllumina,

   
I2.1   buttonEmergency,
   
Q1.0   alarmeEmergency,

   
I2.2   weightExceeded,
   
Q1.1   alarmWeight,
   
   
Q1.2   cabinIsGoingUp,
   
Q1.3   cabinIsGoingDown,

   
M0.0   problemCloseCabin;

network 0 // Begins the control in the sequence waitingLowerFloor (note that the system must be always initiated with the elevator in the LowerFloor and with its door open, by way of manual actuation of the motors after electrical energy failure or maintenance).

if (immed buttonEmergency) {
operate immed alarmeEmergency;
}

if (not immed Photocell or immed weightExceeded or immed obstacleDoor or immed buttonEmergency)
{
operate problemCloseCabin; // Indicates anything wrong that impedes the closing of the cabin
}

while (immed weightExceeded)
{
if (not immed alarmWeight) // Actuates immediately the alarm, and hold it, while the weight excess subsists
{
operate immed alarmWeight;
}
}

if (not VarAux)
{
operate Início; // Generates the pulse in the variable Start on beginning of the operation (1st cycle)
or (VarAux)
{
operate VarAux;
}
}

if (Início)
{
turn_on waitingLower; // Activates the initial sequence when at beginning of the operation
}

//**************** Begin sequence waitingLower ****************

network 1 // Seq. waitingLower: cabin stopped in the lower floor waiting calls/users

sequence waitingLower

network 2 // Unlatches door of the lower floor to permit that the users enter into elevator.

if (not immed unlockDoorLower) {
turn_on immed unlockDoorLower;
reset timeMinOpenLower;
}

when (unlockDoorLower) temporize timeMinOpenLower 3 s;

if (immed doorOpenLower or not immed Photocell or immed obstacleDoor) { // The cabin only is closed after to remain the minimal time with its door open and, if somebody entered, after the ingress of last user, or, if obstructed, after it is unobstructed.
reset timeMinOpenLower;
}

end_circuit_sequence

network 3 // When someone enters and operates the push button to up, or an user call the elevator at superior floor, the PLC latches the door of the lower floor and transfers to sequence closingLower, since the door of the elevator isn't open, the "Emergency" button wasn't pressed, there isn't weight exceeded neither someone at line of the door of the cabin, which is indicated by absence of light on the photocell, and there isn't obstruction impeding its closing. The elevator only is closed after to remain the minimal time with its door open after the last user has entered.

if (immed buttonCab1stFloor or immed buttonCab2ndFloor or immed callUp1stFloor or immed callDown1stFloor or immed call2ndFloor)
{
turn_on immed cabinIsGoingUp;
turn_on immed VentilaIllumina;
}

if (cabinIsGoingUp and not immed doorOpenLower and timeMinOpenLower and not problemCloseCabin)
{
turn_off immed unlockDoorLower; // Unlocks the door of the cabin
transfer_sequence closingLower;
}

network 4 // End of the sequence waitingLower

end_sequence;

//**************** End sequence waitingLower *******************

//**************** Begin sequence waiting1stFloor ****************

network 5 // Seq. waiting1stFloor: cabin stopped in the 1st floor waiting calls/users

sequence waiting1stFloor

network 6 // Unlocks door of 1st floor to permit users enter into cabin.

if (not immed unlockDoor1stFloor) {
turn_on immed unlockDoor1stFloor;
reset timeMinOpen1stFloor;
}

when (unlockDoor1stFloor) temporize timeMinOpen1stFloor 3 s;

if (immed doorOpen1stFloor or not immed Photocell or immed obstacleDoor) {
reset timeMinOpen1stFloor;
}

end_circuit_sequence

network 7

if (not immed cabinIsGoingDown and (immed buttonCab2ndFloor or immed call2ndFloor))
{
turn_on immed cabinIsGoingUp;
turn_on immed VentilaIllumina;
}

if (not immed cabinIsGoingUp and (immed buttonCabLower or immed callLower))
{
turn_on immed cabinIsGoingDown;
turn_on immed VentilaIllumina;
}

if (not immed buttonCab2ndFloor and not immed call2ndFloor and not immed buttonCabLower and not immed callLower)
{
turn_off immed cabinIsGoingUp;
turn_off immed cabinIsGoingDown;
turn_off immed VentilaIllumina;
}

if ((cabinIsGoingUp or cabinIsGoingDown) and not immed doorOpen1stFloor and timeMinOpen1stFloor and not problemCloseCabin)
{
turn_off immed unlockDoor1stFloor;
transfer_sequence closing1stFloor;
}

network 8 // End of the sequence waiting1stFloor

end_sequence;

//**************** End sequence waiting1stFloor ****************

//**************** Begin sequence waiting2ndFloor ****************

network 9 // Seq. waiting2ndFloor: cabin stopped in the 2ndFloor waiting calls/users

sequence waiting2ndFloor

network 10

if (not immed unlockDoor2ndFloor) {
turn_on immed unlockDoor2ndFloor;
reset timeMinOpen2ndFloor;
}

when (unlockDoor2ndFloor) temporize timeMinOpen2ndFloor 3 s;

if (immed doorOpen2ndFloor or not immed Photocell or immed obstacleDoor)
{
reset timeMinOpen2ndFloor;
}

end_circuit_sequence

network 11

if (immed buttonCabLower or immed buttonCab1stFloor or immed callUp1stFloor or immed callDown1stFloor or immed callLower)
{
turn_on immed cabinIsGoingDown;
turn_on immed VentilaIllumina;
}

if (cabinIsGoingDown and not immed doorOpen2ndFloor and timeMinOpen2ndFloor and not problemCloseCabin)
{
turn_off immed unlockDoor2ndFloor;
transfer_sequence closing2ndFloor;
}

network 12 // End of the sequence waiting2ndFloor

end_sequence;

//**************** End sequence waiting2ndFloor ****************

//**************** Begin sequence closingLower ****************

network 13 // Seq. closingLower: cabin stopped in the lower floor and closing its door

sequence closingLower

network 14

if (not immed motorCloseCabin) {
turn_on immed motorCloseCabin;
}

end_circuit_sequence

network 15

if (immed doorOpenLower or not immed Photocell or immed buttonEmergency or immed obstacleDoor)
{
turn_off immed motorCloseCabin;
transfer_sequence openingLower;
}
else
{
if (immed cabinClosed)
{
turn_off immed motorCloseCabin;
transfer_sequence goingUpLower;
}
}

network 16 // End of the sequence closingLower

end_sequence;

//**************** End sequence closingLower ****************

//**************** Begin sequence closing1stFloor ****************

network 17 // Seq. closing1stFloor: cabin stopped in the 1stFloor and closing its door

sequence closing1stFloor

network 18

if (not immed motorCloseCabin) {
turn_on immed motorCloseCabin;
}

end_circuit_sequence

network 19

if (immed doorOpen1stFloor or not immed Photocell or immed obstacleDoor or immed buttonEmergency)
{
turn_off immed motorCloseCabin;
transfer_sequence opening1stFloor;
}
else
{
if (immed cabinClosed)
{
turn_off immed motorCloseCabin;

if (cabinIsGoingUp)
{
transfer_sequence goingUp1stFloor;
}

if (cabinIsGoingDown)
{
transfer_sequence goingDown1stFloor;
}
}
}

network 20 // End of the sequence closing1stFloor

end_sequence;

//**************** End sequence closing1stFloor ****************

//**************** Begin sequence closing2ndFloor ****************

network 21 // Seq. closing2ndFloor: cabin stopped in the 2ndFloor and closing its door

sequence closing2ndFloor

network 22

if (not immed motorCloseCabin) {
turn_on immed motorCloseCabin;
}

end_circuit_sequence

network 23

if (immed doorOpen2ndFloor or not immed Photocell or immed obstacleDoor or immed buttonEmergency)
{
turn_off immed motorCloseCabin;
transfer_sequence opening2ndFloor;
}
else
{
if (immed cabinClosed)
{
turn_off immed motorCloseCabin;
transfer_sequence goingDown2ndFloor;
}
}

network 24 // End of the sequence closing2ndFloor

end_sequence;

//**************** End sequence closing2ndFloor ****************

//**************** Begin sequence openingLower****************

network 25 // Seq. openingLower: cabin stopped in the lower floor and opening its door

sequence openingLower

network 26

if (not immed motorOpenCabin) {
turn_on immed motorOpenCabin;
}

end_circuit_sequence

network 27 // When the cabin is open, it stays waiting calls or users.

if (immed cabinOpen) {
turn_off immed motorOpenCabin;
turn_off immed cabinIsGoingDown;
turn_off immed VentilaIllumina;
transfer_sequence waitingLower;
}

network 28 // End of the sequence openingLower

end_sequence;

//**************** End sequence openingLower****************

//**************** Begin sequence opening1stFloor ****************

network 29 // Seq. opening1stFloor: cabin stopped in the 1stFloor and opening its door

sequence opening1stFloor

network 30 // Turn on opening of the door of the cabin.

if (not immed motorOpenCabin) {
turn_on immed motorOpenCabin;
}

end_circuit_sequence

network 31 // When the cabin is open, it stays waiting calls or users.

if (immed cabinOpen)
{
turn_off immed motorOpenCabin;
transfer_sequence waiting1stFloor;
}

network 32 // End of the sequence opening1stFloor

end_sequence;

//**************** End sequence opening1stFloor ****************

//**************** Begin sequence opening2ndFloor ****************

network 33 // Seq. opening2ndFloor: cabin stopped in the 2ndFloor and opening its door

sequence opening2ndFloor

network 34 // Turn on opening of the door of the cabin.

if (not immed motorOpenCabin)
{
turn_on immed motorOpenCabin;
}

end_circuit_sequence

network 35 // When the cabin is open, it stays waiting calls or users.

if (immed cabinOpen)
{
turn_off immed motorOpenCabin;
turn_off immed cabinIsGoingUp;
turn_off immed VentilaIllumina;
transfer_sequence waiting2ndFloor;
}

network 36 // End of the sequence opening2ndFloor

end_sequence;

//**************** End sequence opening2ndFloor ****************

//**************** Begin sequence goingUpLower****************

network 37 // Seq. goingUpLower: cabin goingUp from lower floor to the 1st floor.

sequence goingUpLower

network 38 // Liga motor para subida of the cabin.

if (not immed motorUpCabin) {
turn_on immed motorUpCabin;
}

end_circuit_sequence

network 39 // When the cabin comes to the first floor, this net verifies if it must stop or continue.

if (immed cabinIs1stFloor and not immed buttonCab2ndFloor and not immed call2ndFloor)
{
turn_off immed cabinIsGoingUp;
turn_off immed VentilaIllumina;
}

if (immed cabinIs1stFloor and (immed buttonCab1stFloor or immed callUp1stFloor
or (immed callDown1stFloor and not immed cabinIsGoingUp) )
or immed buttonEmergency)
{
turn_off immed motorUpCabin;
transfer_sequence opening1stFloor;
}
else
{
if (immed cabinIs1stFloor)
{
transfer_sequence goingUp1stFloor;
}
}

network 40 // End of the sequence goingUpLower

end_sequence;

//**************** End sequence goingUpLower ****************

//**************** Begin sequence goingUp1stFloor ****************

network 41 // Seq. goingUp1stFloor: cabin goingUp from 1º to the 2nd floor.

sequence goingUp1stFloor

network 42 // Liga motor para subida of the cabin.

if (not immed motorUpCabin) {
turn_on immed motorUpCabin;
}

end_circuit_sequence

network 43 // When the cabin arrives at the 2nd floor, turn off the motor.

if (immed cabinIs2ndFloor)
{
turn_off immed motorUpCabin;
turn_off immed cabinIsGoingUp;
turn_off immed VentilaIllumina;
transfer_sequence opening2ndFloor;
}

network 44 // End of the sequence goingUp1stFloor

end_sequence;

//**************** End sequence goingUp1stFloor ****************

//**************** Begin sequence goingDown1stFloor ****************

network 45 // Seq. goingDown1stFloor: cabin goingDown from 1st floor to the Lower.

sequence goingDown1stFloor

network 46 // Liga motor para descida of the cabin.

if (not immed motorDownCabin) {
turn_on immed motorDownCabin;
}

end_circuit_sequence

network 47 // When the cabin arrives at the Lower, turn off the motor.

if (immed cabinIsLower)
{
turn_off immed motorDownCabin;
turn_off immed cabinIsGoingDown;
turn_off immed VentilaIllumina;
transfer_sequence openingLower;
}

network 48 // End of the sequence goingDown1stFloor

end_sequence;

//**************** End sequence goingDown1stFloor ****************

//**************** Begin sequence goingDown2ndFloor ****************

network 49 // Seq. goingDown2ndFloor: cabin goingDown from 2nd floor to the 1st floor.

sequence goingDown2ndFloor

network 50

if (not immed motorDownCabin) {
turn_on immed motorDownCabin;
}

end_circuit_sequence

network 51 // When the cabin comes to the first floor, this net verifies if it must stop or continue.

if (immed cabinIs1stFloor and not immed buttonCabLower and not immed callLower)
{
turn_off immed cabinIsGoingDown;
turn_off immed VentilaIllumina;
}

if (immed cabinIs1stFloor and (immed buttonCab1stFloor or immed callDown1stFloor
or (immed callUp1stFloor and not immed cabinIsGoingDown) )
or immed buttonEmergency)
{
turn_off immed motorDownCabin;
transfer_sequence opening1stFloor;
}
else
{
if (immed cabinIs1stFloor)
{
transfer_sequence goingDown1stFloor;
}
}

network 52 // End of the sequence goingDown2ndFloor

end_sequence;

//**************** End sequence goingDown2ndFloor ****************

end



Como result of the compilation of the program
Three_Floor_Elevator above, the SimuPLC 4.0.0 gerou, exatamente, the following code, in Lista of Instruções - IL:


// CLP    Three_Floor_Elevator
// Draft of automatic control of an elevator within building with 3 floors. (Attention: controls that concern directly to human life, like into elevators, boilers, oil pipelines, vehicles, etc., that can take it in risk in the case of bad operation, should be implemented in the real world with special rigor, beyond to have that to attend specific legislation, very rigorous tests, sanction by certificating departments, etc. Normally they are acquired into software package embedded in the controlled equipments. The present control here sketchy has features merely of exemplification and introduction to the study of the interesting and complex field of the elevators controls and related PLC-based ones.)

//
=VAR   I0.0   call2ndFloor
//
=VAR   I0.1   callUp1stFloor
//
=VAR   I0.2   callDown1stFloor
//
=VAR   I0.3   callLower
//
=VAR   I0.4   doorOpen2ndFloor
//
=VAR   I0.5   doorOpen1stFloor
//
=VAR   I0.6   doorOpenLower
//
=VAR   I0.7   cabinClosed
//
=VAR   I1.0   cabinOpen
//
=VAR   T0   timeMinOpenLower
//
=VAR   T1   timeMinOpen1stFloor
//
=VAR   T2   timeMinOpen2ndFloor
//
=VAR   I1.1   buttonCab2ndFloor
//
=VAR   I1.2   buttonCab1stFloor
//
=VAR   I1.3   buttonCabLower
//
=VAR   I1.4   cabinIs2ndFloor
//
=VAR   I1.5   cabinIs1stFloor
//
=VAR   I1.6   cabinIsLower
//
=VAR   I1.7   Photocell
//
=VAR   I2.0   obstacleDoor
//
=VAR   Q0.0   motorUpCabin
//
=VAR   Q0.1   motorDownCabin
//
=VAR   Q0.2   motorOpenCabin
//
=VAR   Q0.3   motorCloseCabin
//
=VAR   Q0.4   unlockDoor2ndFloor
//
=VAR   Q0.5   unlockDoor1stFloor
//
=VAR   Q0.6   unlockDoorLower
//
=VAR   Q0.7   VentilaIllumina
//
=VAR   I2.1   buttonEmergency
//
=VAR   Q1.0   alarmeEmergency
//
=VAR   I2.2   weightExceeded
//
=VAR   Q1.1   alarmWeight
//
=VAR   Q1.2   cabinIsGoingUp
//
=VAR   Q1.3   cabinIsGoingDown
//
=VAR   M0.0   problemCloseCabin

NETWORK    0 // Begins the control in the sequence waitingLowerFloor (note that the system must be always initiated with the elevator in the LowerFloor and with its door open, by way of manual actuation of the motors after electrical energy failure or maintenance).

LDI   I2.1
=I    Q1.0

LDNI    I1.7
OI   I2.2
OI   I2.0
OI   I2.1
=   M0.0
// Indicates anything wrong that impedes the closing of the cabin

LBL   ENQ1

LDI   I2.2
NOT
JMP   ENQ2

LDNI    Q1.1
// Actuates immediately the alarm, and hold it, while the weight excess subsists
=I    Q1.1

LDN   V_0
JMP   ENQ1

LBL   ENQ2

LDN   VarAux
=   Início
// Generates the pulse in the variable Start on beginning of the operation (1st cycle)
O   VarAux
=   VarAux

LD   Início
S   waitingLower,   1
// Activates the initial sequence when at beginning of the operation
//**************** Begin sequence waitingLower ****************

NETWORK    1 // Seq. waitingLower: cabin stopped in the lower floor waiting calls/users

LSCR   waitingLower

NETWORK    2 // Unlatches door of the lower floor to permit that the users enter into elevator.

LDNI    Q0.6
SI    Q0.6,   1
R   T0,   1

LD   Q0.6
TON   T0,   3000

LDI   I0.6
ONI    I1.7
OI   I2.0
// The cabin only is closed after to remain the minimal time with its door open and, if somebody entered, after the ingress of last user, or, if obstructed, after it is unobstructed.
R   T0,   1

NETWORK    3 // When someone enters and operates the push button to up, or an user call the elevator at superior floor, the PLC latches the door of the lower floor and transfers to sequence closingLower, since the door of the elevator isn't open, the "Emergency" button wasn't pressed, there isn't weight exceeded neither someone at line of the door of the cabin, which is indicated by absence of light on the photocell, and there isn't obstruction impeding its closing. The elevator only is closed after to remain the minimal time with its door open after the last user has entered.

LDI   I1.2
OI   I1.1
OI   I0.1
OI   I0.2
OI   I0.0
SI    Q1.2,   1
SI    Q0.7,   1

LD   Q1.2
ANI    I0.6
A    T0
AN   M0.0
RI    Q0.6,   1
// Unlocks the door of the cabin

SCRT   closingLower

NETWORK    4 // End of the sequence waitingLower

SCRE
//**************** End sequence waitingLower *******************
//**************** Begin sequence waiting1stFloor ****************

NETWORK    5 // Seq. waiting1stFloor: cabin stopped in the 1st floor waiting calls/users

LSCR   waiting1stFloor

NETWORK    6 // Unlocks door of 1st floor to permit users enter into cabin.

LDNI    Q0.5
SI    Q0.5,   1
R   T1,   1

LD   Q0.5
TON   T1,   3000

LDI   I0.5
ONI    I1.7
OI   I2.0
R   T1,   1

NETWORK    7

LDNI    Q1.3

LDI   I1.1
OI   I0.0
ALD
SI    Q1.2,   1
SI    Q0.7,   1

LDNI    Q1.2

LDI   I1.3
OI   I0.3
ALD
SI    Q1.3,   1
SI    Q0.7,   1

LDNI    I1.1
ANI    I0.0
ANI    I1.3
ANI    I0.3
RI    Q1.2,   1
RI    Q1.3,   1
RI    Q0.7,   1

LD   Q1.2
O    Q1.3
ANI    I0.5
A    T1
AN   M0.0
RI    Q0.5,   1

SCRT   closing1stFloor

NETWORK    8 // End of the sequence waiting1stFloor

SCRE
//**************** End sequence waiting1stFloor ****************
//**************** Begin sequence waiting2ndFloor ****************

NETWORK    9 // Seq. waiting2ndFloor: cabin stopped in the 2ndFloor waiting calls/users

LSCR   waiting2ndFloor

NETWORK    10

LDNI    Q0.4
SI    Q0.4,   1
R   T2,   1

LD   Q0.4
TON   T2,   3000

LDI   I0.4
ONI    I1.7
OI   I2.0
R   T2,   1

NETWORK    11

LDI   I1.3
OI   I1.2
OI   I0.1
OI   I0.2
OI   I0.3
SI    Q1.3,   1
SI    Q0.7,   1

LD   Q1.3
ANI    I0.4
A    T2
AN   M0.0
RI    Q0.4,   1

SCRT   closing2ndFloor

NETWORK    12 // End of the sequence waiting2ndFloor

SCRE
//**************** End sequence waiting2ndFloor ****************
//**************** Begin sequence closingLower ****************

NETWORK    13 // Seq. closingLower: cabin stopped in the lower floor and closing its door

LSCR   closingLower

NETWORK    14

LDNI    Q0.3
SI    Q0.3,   1

NETWORK    15

LDI   I0.6
ONI    I1.7
OI   I2.1
OI   I2.0
RI    Q0.3,   1

SCRT   openingLower

LDI   I0.6
ONI    I1.7
OI   I2.1
OI   I2.0
NOT

LDI   I0.7
ALD
RI    Q0.3,   1

SCRT   goingUpLower

NETWORK    16 // End of the sequence closingLower

SCRE
//**************** End sequence closingLower ****************
//**************** Begin sequence closing1stFloor ****************

NETWORK    17 // Seq. closing1stFloor: cabin stopped in the 1stFloor and closing its door

LSCR   closing1stFloor

NETWORK    18

LDNI    Q0.3
SI    Q0.3,   1

NETWORK    19

LDI   I0.5
ONI    I1.7
OI   I2.0
OI   I2.1
RI    Q0.3,   1

SCRT   opening1stFloor
NOT

LDI   I0.7
ALD
RI    Q0.3,   1
LPS

LD   Q1.2
ALD

SCRT   goingUp1stFloor
LPP

LD   Q1.3
ALD

SCRT   goingDown1stFloor

NETWORK    20 // End of the sequence closing1stFloor

SCRE
//**************** End sequence closing1stFloor ****************
//**************** Begin sequence closing2ndFloor ****************

NETWORK    21 // Seq. closing2ndFloor: cabin stopped in the 2ndFloor and closing its door

LSCR   closing2ndFloor

NETWORK    22

LDNI    Q0.3
SI    Q0.3,   1

NETWORK    23

LDI   I0.4
ONI    I1.7
OI   I2.0
OI   I2.1
RI    Q0.3,   1

SCRT   opening2ndFloor

LDI   I0.4
ONI    I1.7
OI   I2.0
OI   I2.1
NOT

LDI   I0.7
ALD
RI    Q0.3,   1

SCRT   goingDown2ndFloor

NETWORK    24 // End of the sequence closing2ndFloor

SCRE
//**************** End sequence closing2ndFloor ****************
//**************** Begin sequence openingLower****************

NETWORK    25 // Seq. openingLower: cabin stopped in the lower floor and opening its door

LSCR   openingLower

NETWORK    26

LDNI    Q0.2
SI    Q0.2,   1

NETWORK    27 // When the cabin is open, it stays waiting calls or users.

LDI   I1.0
RI    Q0.2,   1
RI    Q1.3,   1
RI    Q0.7,   1

SCRT   waitingLower

NETWORK    28 // End of the sequence openingLower

SCRE
//**************** End sequence openingLower****************
//**************** Begin sequence opening1stFloor ****************

NETWORK    29 // Seq. opening1stFloor: cabin stopped in the 1stFloor and opening its door

LSCR   opening1stFloor

NETWORK    30 // Turn on opening of the door of the cabin.

LDNI    Q0.2
SI    Q0.2,   1

NETWORK    31 // When the cabin is open, it stays waiting calls or users.

LDI   I1.0
RI    Q0.2,   1

SCRT   waiting1stFloor

NETWORK    32 // End of the sequence opening1stFloor

SCRE
//**************** End sequence opening1stFloor ****************
//**************** Begin sequence opening2ndFloor ****************

NETWORK    33 // Seq. opening2ndFloor: cabin stopped in the 2ndFloor and opening its door

LSCR   opening2ndFloor

NETWORK    34 // Turn on opening of the door of the cabin.

LDNI    Q0.2
SI    Q0.2,   1

NETWORK    35 // When the cabin is open, it stays waiting calls or users.

LDI   I1.0
RI    Q0.2,   1
RI    Q1.2,   1
RI    Q0.7,   1

SCRT   waiting2ndFloor

NETWORK    36 // End of the sequence opening2ndFloor

SCRE
//**************** End sequence opening2ndFloor ****************
//**************** Begin sequence goingUpLower****************

NETWORK    37 // Seq. goingUpLower: cabin goingUp from lower floor to the 1st floor.

LSCR   goingUpLower

NETWORK    38 // Liga motor para subida of the cabin.

LDNI    Q0.0
SI    Q0.0,   1

NETWORK    39 // When the cabin comes to the first floor, this net verifies if it must stop or continue.

LDI   I1.5
ANI    I1.1
ANI    I0.0
RI    Q1.2,   1
RI    Q0.7,   1

LDI   I1.5

LDI   I1.2
OI   I0.1

LDI   I0.2
ANI    Q1.2
OLD
ALD
OI   I2.1
RI    Q0.0,   1

SCRT   opening1stFloor
NOT

LDI   I1.5
ALD

SCRT   goingUp1stFloor

NETWORK    40 // End of the sequence goingUpLower

SCRE
//**************** End sequence goingUpLower ****************
//**************** Begin sequence goingUp1stFloor ****************

NETWORK    41 // Seq. goingUp1stFloor: cabin goingUp from 1º to the 2nd floor.

LSCR   goingUp1stFloor

NETWORK    42 // Liga motor para subida of the cabin.

LDNI    Q0.0
SI    Q0.0,   1

NETWORK    43 // When the cabin arrives at the 2nd floor, turn off the motor.

LDI   I1.4
RI    Q0.0,   1
RI    Q1.2,   1
RI    Q0.7,   1

SCRT   opening2ndFloor

NETWORK    44 // End of the sequence goingUp1stFloor

SCRE
//**************** End sequence goingUp1stFloor ****************
//**************** Begin sequence goingDown1stFloor ****************

NETWORK    45 // Seq. goingDown1stFloor: cabin goingDown from 1st floor to the Lower.

LSCR   goingDown1stFloor

NETWORK    46 // Liga motor para descida of the cabin.

LDNI    Q0.1
SI    Q0.1,   1

NETWORK    47 // When the cabin arrives at the Lower, turn off the motor.

LDI   I1.6
RI    Q0.1,   1
RI    Q1.3,   1
RI    Q0.7,   1

SCRT   openingLower

NETWORK    48 // End of the sequence goingDown1stFloor

SCRE
//**************** End sequence goingDown1stFloor ****************
//**************** Begin sequence goingDown2ndFloor ****************

NETWORK    49 // Seq. goingDown2ndFloor: cabin goingDown from 2nd floor to the 1st floor.

LSCR   goingDown2ndFloor

NETWORK    50

LDNI    Q0.1
SI    Q0.1,   1

NETWORK    51 // When the cabin comes to the first floor, this net verifies if it must stop or continue.

LDI   I1.5
ANI    I1.3
ANI    I0.3
RI    Q1.3,   1
RI    Q0.7,   1

LDI   I1.5

LDI   I1.2
OI   I0.2

LDI   I0.1
ANI    Q1.3
OLD
ALD
OI   I2.1
RI    Q0.1,   1

SCRT   opening1stFloor
NOT

LDI   I1.5
ALD

SCRT   goingDown1stFloor

NETWORK    52 // End of the sequence goingDown2ndFloor

SCRE
//**************** End sequence goingDown2ndFloor ****************