B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
91
AN Q0.0
AN Q0.1
AN T48
TON T47, +20 //2s
NETWORK 36 // Open the door
LD T47
AN M2.0
AN I1.7
= Q0.2
NETWORK 37
LD I1.7
S M1.7, 1
NETWORK 38 // Delay opening door
LD M1.7
TON T48, +70 //7s
NETWORK 39 // Close the door
LD T48
AN I1.6
AN M2.0
= Q0.3
NETWORK 40
LD T48
A I1.6
S M2.0, 1
NETWORK 41 // Delay before lifting elevator-room
LD M2.0
TON T60, +20 //2s
S M2.5, 1
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
92
JMP 1
NETWORK 42 //Arrive at floor 2
LD I0.1
AN Q0.0
AN Q0.1
R M1.1, 1
R M1.2, 1
R M0.5, 1
NETWORK 43 // Delay after stoping elevator-room
LD I0.1
AN Q0.0
AN Q0.1
AN T48
TON T47, +20 //2s
NETWORK 44 // Open the door
LD T47
AN M2.0
AN I1.7
= Q0.2
NETWORK 45
LD I1.7
S M1.7, 1
NETWORK 46 // Delay opening door
LD M1.7
TON T48, +70 //7s
NETWORK 47 // Close the door
LD T48
AN I1.6
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
93
AN M2.0
= Q0.3
NETWORK 48
LD T48
A I1.6
S M2.0, 1
S M2.1, 1
NETWORK 49 // Delay before lifting elevator-room
LD M2.0
TON T60, +20 //2s
S M2.5, 1
NETWORK 50 //Arrive at floor 3
LD I0.2
AN Q0.0
AN Q0.1
R M1.3, 1
R M1.4, 1
R M0.6, 1
NETWORK 51 // Delay after stoping elevator-room
LD I0.2
AN Q0.0
AN Q0.1
AN T48
TON T47, +20 //2s
NETWORK 52 // Open the door
LD T47
AN M2.0
AN I1.7
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
94
= Q0.2
NETWORK 53
LD I1.7
S M1.7, 1
NETWORK 54 // Delay opening door
LD M1.7
TON T48, +70 //7s
NETWORK 55 // Close the door
LD T48
AN I1.6
AN M2.0
= Q0.3
NETWORK 56
LD T48
A I1.6
S M2.0, 1
S M2.2, 1
NETWORK 57 // Delay before lifting elevator-room
LD M2.0
TON T60, +20 //2s
S M2.5, 1
NETWORK 58 //Determine priority level at floor 2
LDN M2.1
JMP 2 // Jumping to determine priority level at floor 3
NETWORK 59
LDW>= T37, T43 //Comparision of time between calling M1.0 and M0.4
JMP 3 // Jumping to compare with M1.0
NETWORK 60
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
95
LDW>= T40, T43 //Comparision of time between calling M1.3 and M0.4
JMP 4 //Q0_0
NETWORK 61
LDW>= T41, T43 //Comparision of time between calling M1.4 and M0.4
JMP 4 //Q0_0
NETWORK 62
LDW>= T42, T43 //Comparision of time between calling M1.5 and M0.4
JMP 4 //Q0_0
NETWORK 63
LDW>= T45, T43 //Comparision of time between calling M0.6 and M0.4
JMP 4 //Q0_0
NETWORK 64
LDW>= T46, T43 //Comparision of time between calling M0.7 and M0.4
JMP 4 //Q0_0
NOT
JMP 5 //Q0_1
NETWORK 65 //Compare with M1.0
LBL 3
NETWORK 66
LDW>= T40, T37 //Comparision of time between calling M1.3 and M1.0
JMP 4 //Q0_0
NETWORK 67
LDW>= T41, T37 //Comparision of time between calling M1.4 and M1.0
JMP 4 //Q0_0
NETWORK 68
LDW>= T42, T37 //Comparision of time between calling M1.5 and M1.0
JMP 4 //Q0_0
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
96
NETWORK 69
LDW>= T45, T37 //Comparision of time between calling M0.6 and M1.0
JMP 4 //Q0_0
NETWORK 70
LDW>= T46, T37 //Comparision of time between calling M0.7 and M1.0
JMP 4 //Q0_0
NOT
JMP 5 //Q0_1
NETWORK 71 //Determine priority level at floor 3
LBL 2
NETWORK 72
LDN M2.2
JMP 1
NETWORK 73
LDW>= T46, T42 //Comparision of time between calling M1.5 and M0.7
JMP 6 // Jumping to compare with M0.7
NETWORK 74
LDW>= T37, T42 //Comparision of time between calling M1.5 and M1.0
JMP 5 //Q0_1
NETWORK 75
LDW>= T38, T42 //Comparision of time between calling M1.5 and M1.1
JMP 5 //Q0_1
NETWORK 76
LDW>= T39, T42 //Comparision of time between calling M1.5 and M1.2
JMP 5 //Q0_1
NETWORK 77
LDW>= T43, T42 //Comparision of time between calling M1.5 and M0.4
JMP 5 //Q0_1
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
97
NETWORK 78
LDW>= T44, T42 //Comparision of time between calling M1.5 and M0.5
JMP 5 //Q0_1
NOT
JMP 4 //Q0_0
NETWORK 79 //Compare with M0.7
LBL 6
NETWORK 80
LDW>= T37, T46 //Comparision of time between calling M1.0 and M0.7
JMP 5 //Q0_1
NETWORK 81
LDW>= T38, T46 //Comparision of time between calling M1.1 and M0.7
JMP 5 //Q0_1
NETWORK 82
LDW>= T39, T46 //Comparision of time between calling M1.2 and M0.7
JMP 5 //Q0_1
NETWORK 83
LDW>= T43, T46 //Comparision of time between calling M0.4 and M0.7
JMP 5 //Q0_1
NETWORK 84
LDW>= T44, T46 //Comparision of time between calling M0.5 and M0.7
JMP 5 //Q0_1
NOT
JMP 4 //Q0_0
NETWORK 85 //Lable
LBL 1
NETWORK 86 //Control motor lifting elevator-room Q0_0
LBL 4
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
98
NETWORK 87
LD T60
LD I0.2
O I0.1
O I0.0
A M1.5
LD I0.1
O I0.0
A M1.3
OLD
LD I0.0
A M1.2
OLD
LD M0.7
O M0.6
O M0.5
A I0.0
OLD
LD M0.7
O M0.6
A I0.1
OLD
LD M0.7
A I0.2
OLD
ALD
S Q0.0, 1
R Q0.1, 1
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
99
JMP 7
NETWORK 88 //Control motor lower elevator-room
LBL 5
NETWORK 89
LD T60
LD I0.2
O I0.1
O I0.3
A M1.0
LD I0.2
O I0.3
A M1.1
OLD
LD I0.3
A M1.4
OLD
LD M0.4
O M0.6
O M0.5
A I0.3
OLD
LD M0.4
O M0.5
A I0.2
OLD
LD M0.4
A I0.1
OLD
.
B¸o c¸o tèt nghiÖp Ph¹m V¨n ThuËn T§H 46
Khoa C¬ §iÖn TR−êng §HNNI - HN
100
ALD
S Q0.1, 1
R Q0.0, 1
NETWORK 90
LBL 7
NETWORK 91 // Reset fags M1.7, M2.1, M2.2
LDN I0.0
ON I0.1
ON I0.2
ON I0.3
R M1.7, 1
R M2.1, 1
R M2.2, 1
.