Professional Documents
Culture Documents
Cac Khoi Ngat
Cac Khoi Ngat
Gæa söû ta ñaõ caøi caáu hình PLC CPU 318 cho Project. Trong cöûa soå Project
baám vaøo Hardware, baám tieáp vaøo slot CPU, môû cöûa soå Time of Day Interrupts
Ngaét thôøi gian lieân keát vôùi khoái döõ lieäu ñòa phöông
SDT INPUT DT D, L, constant Start date and time: The seconds and
milliseconds of the specified start time are
ignored and set to 0.
STATUS
Ví duï 1: Laäp trình ngaét thôøi gian cho baøi toaùn; töø 5:00 saùng thöù hai ñeán
8:00 toái thöù saùu, Q0.0 ON, caùc thôøi gian coøn laïi Q0.0 OFF. Baùo söï coá ôû Q4.1. I0.0
tích cöïc ngaét vaø I0.1 huûy ngaét.
Chöông trình goàm:
OB1 goïi FC12
FC12 ñaët thôøi ñieåm ngaét, tích cöïc ngaét, huûy ngaét
OB10 ñaët/xoùa Q4.0, aán ñònh laàn ngaét keá
OB80 baùo söï coá ôû Q4.1
FC3 ñoåi ngaøy giôø ra daïng thích hôïp
SFC20 truyeàn khoái
Laäp trình FC12
Khoái bieán ñòa phöông:
Variable Name Data Type Declaration Comment
IN_TIME TIME_OF_DAY TEMP Start time
IN_DATE DATE TEMP Start date
OUT_TIME_DATE DATE_AND_TIME TEMP Start date/time converted
OK_MEMORY BOOL TEMP Enable for setting time-of-day interrupt
2/ Ngaét treã
Coù boán ngaét thôøi treã OB20..OB23 ñöôïc kích hoaït bôûi haøm SFC32 (SRT_DINT). Sau
khi goïi SFC32 moät thôøi gian, OB töông öùng seõ hoaït ñoäng. Khi chöa ñeán thôøi ñieåm kích
hoaït coù theå huûy OB baèng SFC33 (CAN_DINT).
CPU 312 Khoâng
CPU 313..316 OB20
CPU 318, 412, 413 OB20, OB21
CPU 414, 416, 417 OB20..23
OUTPUT STATUS
ERROR RET_VAL
Error Code (W#16#...) Explanation
0000 No error occurred
8090 Incorrect parameter OB_NR
Ví duï 2: Moãi khi I0.0 ON thì 10 s sau Q0.0 ON. I0.2 ON thì reset Q0.0. Neáu trong
khoaûng delay maø I0.1 ON thì Q0.0 vaãn OFF
Baûng kyù hieäu:
Address Meaning
I0.0 Input to enable "start time-delay interrupt"
I0.1 Input to cancel a time-delay interrupt
I0.2 Input to reset output Q 4.0
Q4.0 Output set by the time-delay interrupt OB (OB20)
MB1 Used for edge flag and binary result (status bit BR) buffer for SFCs
MW4 STATUS of time-delay interrupt (SFC34 "QRY_TINT")
MD10 Seconds and milliseconds BCD-coded from the start event information of OB1
MW 100 RET_VAL of SFC32 "SRT_DINT"
MW102 RET_VAL of SFC34 "QRY_DINT"
MW104 RET_VAL of SFC33 "CAN_DINT"
MW106 RET_VAL of SFC20 "BLKMOV"
MB120 to Memory for start event information of OB20
MB139
MD140 Seconds and milliseconds BCD-coded from the start event information of OB20
MW144 Seconds and milliseconds BCD-coded from the start event information of OB1; acquired from
start event information of OB20 (user-specific ID SIGN)
Baûng bieán ñòa phöông cuûa OB20