Chương trình điều khiển được viết trên ngôn ngữ STL cho bộđiều khiển khả trình SIMATIC PLC
S7-300 của hãng SIEMENS
Network 1: START/STOP
AN "STOP" A( O "START" O M 0.0 ) = M 0.0
Network 2: DEN START
A M 0.0 AN "DEN_DUNG" = "DEN_CHAY"
Network 3: DEN STOP
A M 0.0 AN "DEN_DUNG" = "DEN_CHAY"
Network 4: CT PHAO THAP
A M 0.0 A "PHAOCAO" = "DEN_CT_THAP"
Network 5: CT PHAO CAO
A M 0.0 A "PHAOTHAP" = "DEN_CT_CAO"
Network 6:DIEU KHIEN DONG CO P1
A M 0.0 A "TD/BT" A( ON M 8.3 O AN "CPLD" AN "LD_P1" ) = "DC_P1"
Network 7: DIEU KHIEN DONG CO P2
A M 0.0 A "TD/BT" A "PHAOTHAP" A(
ON M 8.3 O AN "CPLD" AN "LD_P2" ) = "DC_P2"
Network 8:CHUYEN DOI THANH GIA TRI THUC
A M 0.0 = L 20.0 A L 20.0 JNB _001 CALL FC 1 giatrivao:="PH1" giatrira :=MD100 _001: A BR = M 0.1 A L 20.0 JNB _002 CALL FC 1 giatrivao:="PH2" giatrira :=MD104 _002: A BR = M 0.2
Network 9: KIEM TRA PH1
A M 0.0 A "TD/BT" A M 0.1 A( L MD 100 L 6.800000e+000 <R ) = M 0.3
Network 10:MO VAN NAOH
A M 0.0 A "TD/BT" A M 0.3 FP M 1.3 AN "V_HCL" S "V_NAOH"
Network 11: KIEM TRA PH1
A M 0.0 A "TD/BT" A M 0.1 A( L MD 100 L 7.200000e+000 >R ) = M 0.4 Network 12: MO VAN HCL A M 0.0 A "TD/BT" A M 0.4 FP M 1.4 AN "V_NAOH" S "V_HCL"
Network 13: TAO TRE 2S
A M 0.0 A "TD/BT" A( O "V_NAOH" O "V_HCL" ) L S5T#2S SD T 5
Network 14:KHOI DONG BOM DINH LUONG
A T 5 FP M 0.5 S "DC_DP"
Network 15:DUNG BOM DINH LUONG
A( ON "V_NAOH" ON "V_HCL" ) FP M 0.6 R "DC_DP"
Network 16: TAO TRE 2S
A "DC_DP" L S5T#2S SF T 6
Network 17: KHOA VAN
A T 6 FN M 0.7 R "V_NAOH" R "V_HCL"
Network 18: KIEM TRA PH2
A M 0.0 A M 0.2 A( O( L MD 104 L 7.200000e+000 >=R ) O( L MD 104 L 6.800000e+000 <=R ) ) = M 1.0
Network 19: KIEM TRA PH2 TRONG T(s)
A M 1.0 L S5T#5S SD T 1
Network 20: BAT BAO DONG NEU PH2 VUOT NGUONG LIEN TUC TRONG THOI GIAN T(s)
A M 0.0 A( O T 1 O M 8.3 ) AN "GTSC" = M 8.3
Network 21:DEN VA COI BAO DONG PH2 VUOT NGUONG
A M 0.0 A M 8.3 = "PH_CAO"
Network 22: LAY GIA TRI LUU LUONG
A M 0.0 A "TD/BT" JNB _003 CALL FC 3 gtvao:="LUULUONG"
gtra :=MD128 _003: A BR = M 1.5
Network 23:DIEU KHIEN DONG CO P3
A M 1.5 = L 20.0 A L 20.0 JNB _004 CALL FC 2 vao:=MD128
ra :="TOCDO" _004: A BR = M 1.6 A
L 20.0 BLD 102 = "DC_P3"
A L 20.0 A M 1.6 = "E_BT"
Network 24:TAO TRE 1 GIO
A M 0.0 A "TD/BT" AN T 4 L S5T#1H SD T 4
Network 25: TAO TRE 8 GIO
A T 4 CD C 1 BLD 101 A( O M 0.0 ON M 1.2 ) L C#8 S C 1 NOP 0 NOP 0 NOP 0 A C 1 = M 1.2
Network 26: DK DONG CO HUT BUN
A M 0.0 A "TD/BT" AN T 5 A( ON M 1.2 O "DC_SP" ) = "DC_SP"
Network 27:DUNG DC HUT BUN SAU THOI GIAN T
A "DC_SP" L S5T#20S SD T 5
Network 28:DK BANG TAY
A M 0.0 AN "TD/BT" = L 20.0 A L 20.0 A "SW_P1" = "DC_P1" A L 20.0 A "SW_P2" = "DC_P2" A L 20.0 A "SW_M1" = "DC_M1" A L 20.0 A "SW_M2" = "DC_M2" A L 20.0 A( O "SW_NAOH" O "DC_DP" ) = "V_NAOH" A L 20.0 A( O "SW_HCL" O "DC_DP" ) = "V_HCL" A L 20.0 A( O "V_NAOH" O "V_HCL" ) A "SW_DP" = "DC_DP" A L 20.0 A "SW_SP" = "DC_SP"
Network 29: DK BANG TAY P3
A M 0.0 AN "TD/BT" A "SW_P3" = L 20.0 A L 20.0 JNB _005 CALL FC 2 vao:=7.000000e+000 ra :="TOCDO" _005: A BR = M 1.1 A L 20.0 BLD 102 = "DC_P3" A L 20.0 A M 1.1 = "E_BT"
Network30:DK BANG TAY DC EP BUN
A M 0.0 AN "TD/BT" A "SW_D" = L 20.0 A L 20.0 BLD 102 L S5T#10S SP T 2 A L 20.0 AN "TG_DC_D" A T 2 = "Y_DC_D" A L 20.0 BLD 102 = "DC_D" A L 20.0 AN "Y_DC_D" = "TG_DC_D"
Network31: DK BANG TAY DC THOI KHI
A M 0.0 AN "TD/BT" A "SW_B" = L 20.0 A L 20.0 BLD 102 L S5T#10S SP T 3 A L 20.0 AN "TG_DC_B" A T 3 = "Y_DC_B" A L 20.0 BLD 102 = "DC_B" A L 20.0 AN "Y_DC_B" = "TG_DC_B"
HAM FC1:
Network 1: INT to DINT
CLR _001: A BR = M 2.1
Network 2: DINT to R
A M 2.1 JNB _002 L MD 110 DTR T MD 114 SET SAVE CLR _002: A BR = M 2.2
Network 3 : CHUYEN THANH GIA TRI THUC
A M 2.2 JNB _003 L MD 114 L 5.850710e+002 /R T #giatrira _003: NOP 0
HAM FC2:
Network 1: SO SANH GIA TRI VAO VOI NGUONG DUOI
L #vao L 7.500000e+000 <R = M 3.3
Network 2: NEU NHO HON
A M 3.3 JNB _001 L #vao L 1.000000e-001 +R T MD 130 AN OV SAVE CLR _001: A BR = M 3.4
Network 3: SO SANH GIA TRI VAO VOI NGUONG TREN
L #vao L 8.200000e+000 >R = M 3.5
Network 4: NEU LON HON
A M 3.5
JNB _002 L #vao L 1.000000e-001 -R T MD 130 AN OV SAVE CLR _002: A BR = M 3.6
Network 5: TINH TOAN DE DIEU KHIEN TOC DO DC P3
A( O M 3.4 O M 3.6 ) JNB _003 L MD 130 L 9.045000e+002 *R T MD 120 AN OV SAVE CLR _003: A BR = M 2.3 Network 6: A M 2.3 JNB _004 L MD 120 RND T MD 124 AN OV SAVE CLR _004: A BR = M 2.4 Network 7: A M 2.4 JNB _005 L MD 124 L DW#16#FFF AD T MD 128 SET SAVE CLR _005: A BR = M 2.5 Network 8: A M 2.5 JNB _006 L MD 128 T #ra _006: NOP 0 HAM FC3:
Network 1: INT to DINT
A M 0.0 JNB _001 L #gtvao ITD T MD 120 SET SAVE CLR _001: A BR = M 3.0
Network 2:DINT to R
_002: A BR = M 3.1
Network 3: TINH TOAN GIA TRI THUC
A M 2.2 JNB _003 L MD 124 L 8.191000e+001 /R T #gtra _003: NOP 0
V. TÀI LIỆU THAM KHẢO VÀ SỬ DỤNG
[1] PHẠM THỊ GIỚI; (2003), “Tựđộng hoá các công trình cấp và thoát nước”; NXB Xây
dựng.
[2] SIEMENS; (2003), “Catalog CA01”.
[3] TRUNG TÂM ĐÀO TẠO NGÀNH NƯỚC VÀ MÔI TRƯỜNG; (1999), “Sổ tay xử
lý nước”(tập1, 2); NXB Xây dựng.
[4] TRẦN VĂN NHÂN, NGÔ THỊ NGA; (2002), “Giáo trình công nghệ xử lý nước
thải”; NXB Khoa học và kỹ thuật.
[5] PGS, TS HOÀNG VĂN NHUỆ; (2004), “Công nghệ môi trường, tập1-xử lý nước”;
NXB Xây dựng.
[6] JEAN-PETER YLEN; (2001), "Measuring, modeling and controlling the pH value and the
dynamic chemical state",Helsinki University of Technology Control Engineering Laboratory
[7] CONTROL TECHNIQUE; (2000), “User Guide - Commander SE”.