tài liệu TAPLENH s7300

50 503 0
tài liệu TAPLENH s7300

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Automation and Drives SIMATIC S7-300 TẬP LỆNH   Khái niệm chương trình PLC Tập lệnh          Lệnh bit Lệnh move Lệnh so sánh Lệnh toán học Lệnh chuyển đổi Lệnh dịch xoay Lệnh counter Lệnh timer Hàm chức A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Khái niệm chương trình PLC:   Chương trình PLC ?  Tập hợp lệnh  Sắp xếp theo trình tự Chương trình PLC dùng để làm ?  Nhận thay đổi Inputs  Thực lệnh  Tạo tín hiệu điều khiển Outputs A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Cấu trúc chương trình PLC:  Lập trình tuyến tính: Toàn chương trình lưu khối nhớ - khối OB1 Đây khối chứa lệnh thực thường xuyên chu kỳ quét PLC A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Cấu trúc chương trình PLC:  Lập trình có cấu trúc: Chia chương trình thành phần nhỏ Mỗi phần lưu vùng nhớ khác Các khối chương trình Chương trình liên kết lệnh gọi khối, chuyển khối A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Ngôn ngữ lập trình PLC:  Khái niệm: Cách biểu diễn lệnh viết chương trình cho PLC  Phân loại:  STL  LAD  FBD A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Ngôn ngữ lập trình PLC:  STL (Statement List)    Sử dụng từ gợi nhớ Chương trình liệt kê từ gợi nhớ Phù hợp cho người có kinh nghiệm lập trình A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Ngôn ngữ lập trình PLC:  FBD (Function Block Diagram)   Sử dụng khối logic Chương trình kết nối khối A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Ngôn ngữ lập trình PLC:  LAD (Ladder Logic)    Sử dụng ký hiệu mạch điện Chương trình sơ đồ mạch điện Mô tả chuyển động dòng điện qua tiếp điểm tác động đến tải A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH  LAD (Ladder Logic)  Các phần tử mạch điện Box A&D AS SM6, Page Automation and Drives SIMATIC S7-300 TẬP LỆNH Lệnh bit: lệnh   Lệnh kiểm tra bit:  Lệnh And  Lệnh And Not Lệnh đặt giá trị bit:  Lệnh Output  Lệnh Set  Lệnh Reset A&D AS SM6, Page 10 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-ODT: Hoạt động  S= cạnh lên: Timer khởi động T-word=TV  S=1: Timer chạy T-word=T-word -1 S=1 T-word Q=1 S=0: Timer dừng T-word=T-word R=1: Timer xóa T-word=0, Q=0  A&D AS SM6, Page 36 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-ODT: Hoạt động A&D AS SM6, Page 37 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-PULSE: Hoạt động A&D AS SM6, Page 38 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-PEXT: Hoạt động A&D AS SM6, Page 39 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-ODTS: Hoạt động A&D AS SM6, Page 40 Automation and Drives SIMATIC S7-300 TẬP LỆNH Timer S-OFFDT: Hoạt động A&D AS SM6, Page 41 Automation and Drives SIMATIC S7-300 TẬP LỆNH Thư viện hàm S7-300:  Hàm Scale FC105, Unscale FC106   Hàm Blkmov SFC20   Xử lý giá trị analog Copy khối liệu Hàm Read-clock SFC1  Đọc thời gian thực  Hàm X-Send SFC65 gởi liệu  Hàm X-Rcv SFC66 nhận liệu A&D AS SM6, Page 42 Automation and Drives SIMATIC S7-300 Hàm Scale Hàm Unscale MP hàm phải kèm theo Các khối OB82, OB84, OB85 A&D AS SM6, Page 43 Automation and Drives The SCALE function takes an integer value (IN), converts it to a real value in engineering units scaled between a low and a high limit The result is written in OUT The SCALE function uses the equation: OUT=[((FLOAT(IN) – K1)/(K2–K1))*(HI_LIM – LO_LIM)] + LO_LIM K1, K2 are set based upon whether the input value is BIPOLAR or UNIPOLAR BIPOLAR: The input integer value is assumed to be between –27648 and 27648, therefore, K1 = –27648.0 and K2 = +27648.0 UNIPOLAR: The input integer value is assumed to be between and 27648, therefore,K1=0.0 and K2=+27648.0 A&D AS SM6, Page 44 Automation and Drives EN Input BOOL I,Q,M,D,L Enable input with signal state of activates the box ENO Output BOOL I,Q,M,D,L Enable output has a signal state of if the function is executed without error IN Input INT I,Q,M,D,L,P, Constant The input value to be scaled to a real value in engineering units HI_LIM Input REAL I,Q,M,D,L,P, Constant Upper limit in engineering units LO_LIM Input REAL I,Q,M,D,L,P, Constant Lower limit in engineering units A&D AS SM6, Page 45 Automation and Drives BIPOLAR Input BOOL I,Q,M,D,L A signal state of indicates that the input value is bipolar A signal state of indicates that the input value is unipolar OUT Output REAL I,Q,M,D,L,P Result of the scale conversion RET_VAL Output WORD I,Q,M,D,L,P Returns a value of W#16#0000 if the instruction executes without error A&D AS SM6, Page 46 Automation and Drives The UNSCALE function takes a real input value (IN) in engineering units scaled between a low and a high limit (LO_LIM and HI_LIM) and converts it to an integer value The result is written to OUT The UNSCALE function uses the equation: OUT = [ ((IN–LO_LIM)/(HI_LIM–LO_LIM)) * (K2–K1) ] + K1 and sets the constants K1 and K2 based upon whether the input value is BIPOLAR or UNIPOLAR · BIPOLAR: The output integer value is assumed to be between –27648 and 27648, therefore, K1 = –27648.0 and K2 = +27648.0 · UNIPOLAR: The output integer value is assumed to be between and 27648, therefore, K1 = 0.0 and K2 = +27648.0 If the input value is outside the LO_LIM and HI_LIM range, the output (OUT) is clamped to the nearer of either the low limit or the high limit of the specified range for its type (BIPOLAR or UNIPOLAR) and an error is returned A&D AS SM6, Page 47 Automation and Drives PLC S7300 điều khiển hoạt động lò nhiệt, Cảm biến đo nhiệt độ từ đến 2000C Lò nhiệt hoạt động theo chế độ: •Tự động: công tắc A/M đóng -Khi nhiệt độ giảm nhỏ 350C nhiệt trở cấp điện – đèn đỏ sáng, -Khi nhiệt độ lớn 450C nhiệt trở bị ngắt điện – đèn xanh sáng •Điều khiển tay: công tắc A/M hở -Nhấn nút ON: cấp điện nhiệt trở -Nhấn nút OFF: ngắt điện nhiệt trở Yêu cầu sinh viên: •Vẽ sơ đồ kết nối hệ thống •Phân tích nêu ý tưởng điều khiển •Viết chương trình điều khiển (LAD) A&D AS SM6, Page 48 Automation and Drives A&D AS SM6, Page 49 Automation and Drives With SFC "READ_CLK" (read system clock), you read the current date or current time of the system clock of the CPU Parameter Declaration Data Type Memory Area Description RET_VAL OUTPUT INT I, Q, M, D, L If an error occurs during the execution of the function, the return value contains an error code CDT OUTPUT DT D,L The current date and current time are output at the CDT output A&D AS SM6, Page 50 ... Thực copy liệu từ In sang Out A&D AS SM6, Page 13 Automation and Drives SIMATIC S7-300 TẬP LỆNH Lệnh gán giá trị vùng nhớ:    Hàm SFC20 - BLKMOV Copy liệu từ SRCBLK sang DSTBLK Kiểu liệu ANY... S7-300 TẬP LỆNH Lệnh chuyển đổi liệu: Chuyển đổi qua lại loại liệu: BCD, I, DI, R A&D AS SM6, Page 20 Automation and Drives SIMATIC S7-300 TẬP LỆNH Lệnh chuyển đổi liệu: Đổi bit, đổi dấu, làm tròn... TẬP LỆNH Lệnh toán học:  Thực phép toán + - * / Lượng giác, căn, bình phương, hàm mũ, …  loại liệu  Số nguyên 16 bit  Số nguyên 32 bit  Số thực 32 bit A&D AS SM6, Page 17 Automation and Drives

Ngày đăng: 14/04/2017, 08:30

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan