Iec 61131-3 Second edition 2003-01 Programmable controllers – Part 3: Programming languages


F.10 Function block RTC (Real Time Clock)


Download 1.35 Mb.
Pdf ko'rish
bet155/158
Sana17.06.2023
Hajmi1.35 Mb.
#1528208
1   ...   150   151   152   153   154   155   156   157   158
Bog'liq
ourdev 569653

F.10 Function block RTC (Real Time Clock)
The RTC function block shown below sets the output CDT to the input value PDT at the next evaluation
of the function block following a transition from 0 to 1 of the IN input. The CDT output of the RTC
function block is undefined when the value of IN is 0.
Function block RTC (Real Time Clock)
PDT = Preset date and time,
loaded on rising edge of IN
CDT = Current date and time,
valid when IN=1
Q = copy of IN
+-------+
| RTC |
BOOL---|IN Q|---BOOL
DT-----|PDT CDT|-----DT
+-------+
F.11 Function block ALRM_INT
This function block type provides simple high and low level alarming for an input of type INT and
illustrates the use of the VAR_OUTPUT declaration with functions. The function output is TRUE if a high
or low threshold is exceeded, and separate outputs are provided for the high- or low-level alarm
conditions.
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


61131-3 
 IEC:2003(E)
– 207 –
+----------+
| ALRM_INT |
IN----|INT |---BOOL
THI---|INT HI|---BOOL
THL---|INT LO|---BOOL
+----------+
+---+
IN---| > |---+-----------------HI
THI--| | | +----+
+---+ +--| OR |---ALRM_INT
+---| |
+---+ | +----+
IN---| < |--+------------------LO
THL--| |
+---+
FUNCTION ALRM_INT : BOOL
VAR_INPUT
INT : IN ;
INT : THI ; (* High threshold *)
INT : TLO ; (* Low threshold *)
END_VAR
VAR_OUTPUT
HI: BOOL; (* High level alarm *)
LO: BOOL; (* Low level alarm *)
END_VAR
HI := IN > THI ;
LO := IN < THL ;
ALRM_INT := THI OR THL ;
END_FUNCTION
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


– 208 –
61131-3 
 IEC:2003(E)

Download 1.35 Mb.

Do'stlaringiz bilan baham:
1   ...   150   151   152   153   154   155   156   157   158




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling