Basic Programming Simatic S7300 Cấu trúc một chương trình trong PLC khá đơn giản, chương trình được tạo thành từ 03 thành phần cơ bản: một chương trình chính (main program); có thể có một hay nhiều chương trình con (subroutines); các chương trình con xử lý ngắt (interrupt routines) có thể có hoặc không. • Chương trình chính bao gồm các lệnh điều khiển ứng dụng. Các lệnh này được thực hiện tuần tự một cách liên tục, cứ mỗi vòng quét một lần. • Các chương trình con, có thể có hoặc không tùy yêu cầu, chỉ được thực hiện nếu được gọi đến từ chương trình chính. • Các chương trình con xử lý ngắt (có thể có hoặc không) được thực hiện khi xảy ra sự kiện gắn với ngắt tương ứng. Sự kiện đó có thể là sự thay đổi mức ở một đầu vào, bộ định thời đếm đủ hay nhận được dữ liệu trên cổng truyền thông, . . .
Trang 1By: Andri Kuncoro
Trang 2SIMATIC Overview
Trang 3SIMATIC Controller (PLC)
S7-200
S7-300
S7-400
Trang 4S7 – 300
Features :
Modular small controll system
Performance graded range of CPU
Extensive selection of modules
Expandable design with up to 32 modules
Backplane bus integrated in the modules
Can be networked with MPI, Profibus or Industrial ethernet
Central PG/PC connection with access to all modules
No slot restrictions
Configuration and parameter setting with the help “HW Config”
Trang 5S7 – 300
SF = Group error, internal CPU or fault in module
DC5V = Internal 5 VDC voltage indicator
then steady light in Run mode
configuration Mode Selector
Status Indicator
Trang 6Starting with SIMATIC Manager
Trang 7SIMATIC Manager menus and toolbars
Trang 8Standard Library
Trang 9Context-Sensitive Help in S7
F1
Trang 10Creating a project
Trang 11Insert Station
Trang 12Starting Hardware Configuration Editor
Trang 13Generating a Hardware setpoint Configuration
Trang 15Module Address Overview
Trang 16Variable Addressing
2x
Trang 17CPU Properties
2x
Trang 18Saving the HW Configuration and Downloading it
in the Module
Trang 19Inserting S7 Block
Trang 21Block architecture and Block editor
Trang 22Program Structure
Trang 23Binary Operation
AND - OPERATION
ASSIGNMENT
Trang 24Binary Operation
OR - OPERATION
Trang 25EXCLUSIVE - OR - OPERATION
Binary Operation
Trang 26RESET DOMINANT
SET DOMINANT
Trang 27Binary Operation
POSITIVE EDGE
Trang 28Binary Operation
NEGATIVE EDGE
Trang 29Binary Operation
JUMP UNCONDITIONAL (JU)
JUMP CONDITIONAL (JC)
Trang 30Digital Operation
BIT
BYTE
WORD
For a unit of 8 binary characters, the term BYTE is used A byte has the size of 8 bits
A word also has the size of 2 bytes or 16 bits
A double-word corresponds to the word length of 32 binary characters
A double-word also has the size of 2 words, 4 bytes, or 32 bits
DOUBLE-WORD
Trang 32PULSE TIMER
Digital Operation
Trang 33EXTENDED PULSE TIMER
Digital Operation
Trang 34ON –DELAY TIMER
Digital Operation
Trang 35OFF-DELAY TIMER
Digital Operation
Trang 36COUNTER OPERATIONS
Digital Operation
Trang 37COMPARISON FUNCTIONS
Digital Operation
<> IN1 is not equal to IN2
> IN1 is greater than IN2
< IN1 is less than IN2
>= IN1 is greater than or equal to IN2
<= IN1 is less than or equal to IN2
Trang 38Digital Operation
Trang 39Data Block
Trang 40Scale & Unscaled
Trang 41Matur Suwun…