Phương hướng phát triển

Một phần của tài liệu MÔ PHỎNG hệ THỐNG điều KHIỂN và GIÁM sát dây CHUYỀN sản XUẤT nước TINH KHIẾT DÙNG PLC s7 1200 và SCADA, có CODE (Trang 45 - 63)

Hệ thống có thể phát triển thành một hệ thống thực tế điều khiển các cơ cấu chấp hành có thật trong công nghiệp.. Tạo dựng các thiết bị đầy đủ các thành phần như nguồn, relay, cảm biến,... Xây dựng hệ thống mạng truyền thông phù hợp phân chia các cấp phù hợp

Không những thế để loại bỏ về khả năng vị trí địa lý, có thể nâng cấp giao thức giám sát điều khiển bằng mạng Ethernet thay cho mạng Lan chỉ có thể áp dụng trong phạm vi không gian nhà máy

Tạo dựng trang web chứa dữ liệu của hệ thống thông qua cơ sở dữ liệu SQL, để thao tác, quản lí dữ liệu. có thể truy cập ở mọi nền tảng: máy tính, Ipad, điện thoại,...

TÀI LIỆU THAM KHẢO

Tài liệu:

[1]Giáo trình tài liệu lập trình PLC S7 1200 [2]Giáo trình lập trình PLC - Bộ xây dựng [3]Datasheet S7-1200 Programmable controller

Website: http://miru.com.vn/quy-trinh-san-xuat-nuoc-tinh-khiet https://www.youtube.com/watch?v=vozkBhbXC64&list=WL&index=6 https://www.youtube.com/watch?v=uSZwj5KUr2A&list=WL&index=10 https://www.youtube.com/watch?v=bmzo8wBteK4&list=WL&index=13 https://www.youtube.com/watch?v=8Ac2ydilswc&list=WL&index=17 https://www.youtube.com/watch? v=8BhfrYmJFKo&list=WL&index=2&t=557s

Sub dat_giatri() 'Tip:

' 1. Use the <CTRL+SPACE> or <CTRL+I> shortcut to open a list of all objects and functions

' 2. Write the code using the HMI Runtime object. ' Example: HmiRuntime.Screens("Screen_1").

Dim objConnection Dim strConnectionString Dim GIATRI1 Dim GIATRI2 Dim strSQL Dim objCommand strConnectionString = "Provider=MSDASQL;DSN=LK-do- an;UID=TK;PWD=PASS;" GIATRI1 = HMIRuntime.Tags("giatri_dat_ml_1chai").Read GIATRI2 = HMIRuntime.Tags("so_sanpham_1_thung").Read

strSQL = "INSERT INTO bang_dat (thoi_gian,so_ml_dat,so_chai_dat) VALUES ( GETDATE()," & GIATRI1 & "," & GIATRI2 & ");"

Set objConnection = CreateObject("ADODB.Connection") objConnection.ConnectionString = strConnectionString objConnection.Open

Set objCommand = CreateObject("ADODB.Command") With objCommand

.ActiveConnection = objConnection .CommandText = strSQL

End With

objCommand.Execute Set objCommand = Nothing

End Sub

- Dem_sanpham:

Sub dem_sanpham() 'Tip:

' 1. Use the <CTRL+SPACE> or <CTRL+I> shortcut to open a list of all objects and functions

' 2. Write the code using the HMI Runtime object. ' Example: HmiRuntime.Screens("Screen_1").

' 3. Use the <CTRL+J> shortcut to create an object reference. 'Write the code as of this position:

Dim objConnection Dim strConnectionString Dim GIATRI1 Dim GIATRI2 Dim GIATRI3 Dim GIATRI4 Dim strSQL Dim objCommand strConnectionString = "Provider=MSDASQL;DSN=LK-do- an;UID=TK;PWD=PASS;" GIATRI1 = HMIRuntime.Tags("dem_cambien_1").Read

GIATRI4 = HMIRuntime.Tags("so_thung_sanxuat").Read strSQL = "INSERT INTO bang_dem

(thoi_gian,so_chai_vao_bangchuyen,so_chai_dong_nap,so_thung_vao_bangchuyen ,so_thung_san_xuat) VALUES ( GETDATE()," & GIATRI1 & "," & GIATRI2 & "," & GIATRI3 & "," & GIATRI4 & ");"

Set objConnection = CreateObject("ADODB.Connection") objConnection.ConnectionString = strConnectionString objConnection.Open

Set objCommand = CreateObject("ADODB.Command") With objCommand

.ActiveConnection = objConnection .CommandText = strSQL

End With

objCommand.Execute Set objCommand = Nothing objConnection.Close

Set objConnection = Nothing

Một phần của tài liệu MÔ PHỎNG hệ THỐNG điều KHIỂN và GIÁM sát dây CHUYỀN sản XUẤT nước TINH KHIẾT DÙNG PLC s7 1200 và SCADA, có CODE (Trang 45 - 63)