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


Download 1.35 Mb.
Pdf ko'rish
bet70/158
Sana17.06.2023
Hajmi1.35 Mb.
#1528208
1   ...   66   67   68   69   70   71   72   73   ...   158
Bog'liq
ourdev 569653

(ST language - see 3.3)
Up-counter
1a
+-----+
| CTU |
BOOL--->CU Q|---BOOL
BOOL---|R |
INT---|PV CV|---INT
+-----+
IF R THEN CV := 0 ;
ELSIF CU AND (CV < PVmax)
THEN CV := CV+1;
END_IF ;
Q := (CV >= PV) ;
1b
+----------+
| CTU_DINT |
BOOL--->CU Q|---BOOL
BOOL---|R |
DINT---|PV CV|---DINT
+----------+
Same as 1a
1c
+----------+
| CTU_LINT |
BOOL--->CU Q|---BOOL
BOOL---|R |
LINT---|PV CV|---LINT
+----------+
Same as 1a
1d
+-----------+
| CTU_UDINT |
BOOL--->CU Q|---BOOL
BOOL---|R |
UDINT---|PV CV|---UDINT
+-----------+
Same as 1a
1e
+-----------+
| CTU_ULINT |
BOOL--->CU Q|---BOOL
BOOL---|R |
ULINT---|PV CV|---ULINT
+-----------+
Same as 1a
Down-counter
2a
+-----+
| CTD |
BOOL--->CD Q|---BOOL
BOOL---|LD |
INT---|PV CV|---INT
+-----+
IF LD THEN CV := PV ;
ELSIF CD AND (CV > PVmin)
THEN CV := CV-1;
END_IF ;
Q := (CV <= 0) ;
2b
+----------+
| CTD_DINT |
BOOL--->CD Q|---BOOL
BOOL---|LD |
DINT---|PV CV|---DINT
+----------+
Same as 2a
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


– 80 –
61131-3 
 IEC:2003(E)
Table 36 - Standard counter function blocks
No.
Graphical form
Function block body
(ST language - see 3.3)
2c
+----------+
| CTD_LINT |
BOOL--->CD Q|---BOOL
BOOL---|LD |
LINT---|PV CV|---LINT
+----------+
Same as 2a
2d
+-----------+
| CTD_UDINT |
BOOL--->CD Q|---BOOL
BOOL---|LD |
UDINT---|PV CV|---UDINT
+-----------+
Same as 2a
2e
+-----------+
| CTD_ULINT |
BOOL--->CD Q|---BOOL
BOOL---|LD |
ULINT---|PV CV|---ULINT
+-----------+
Same as 2a
Up-down counter
3a
+------+
| CTUD |
BOOL--->CU QU|---BOOL
BOOL--->CD QD|---BOOL
BOOL---|R |
BOOL---|LD |
INT---|PV CV|---INT
+------+
IF R THEN CV := 0 ;
ELSIF LD THEN CV := PV ;
ELSE
IF NOT (CU AND CD) THEN
IF CU AND (CV < PVmax)
THEN CV := CV+1;
ELSIF CD AND (CV > PVmin)
THEN CV := CV-1;
END_IF;
END_IF;
END_IF ;
QU := (CV >= PV) ;
QD := (CV <= 0) ;
3b
+-----------+
| CTUD_DINT |
BOOL--->CU QU|---BOOL
BOOL--->CD QD|---BOOL
BOOL---|R |
BOOL---|LD |
DINT---|PV CV|---DINT
+-----------+
Same as 3a
3c
+-----------+
| CTUD_LINT |
BOOL--->CU QU|---BOOL
BOOL--->CD QD|---BOOL
BOOL---|R |
BOOL---|LD |
LINT---|PV CV|---LINT
+-----------+
Same as 3a
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)
– 81 –
Table 36 - Standard counter function blocks
No.
Graphical form
Function block body
(ST language - see 3.3)
3d
+------------+
| CTUD_ULINT |
BOOL--->CU QU|---BOOL
BOOL--->CD QD|---BOOL
BOOL---|R |
BOOL---|LD |
ULINT---|PV CV|---ULINT
+------------+
Same as 3a
NOTE The numerical values of the limit variables PVmin and PVmax are implementation-
dependent
.
2.5.2.3.4 Timers
The graphic form for standard timer function blocks shall be as shown in table 37. The operation of
these function blocks shall be as defined in the timing diagrams given in table 38.
Table 37 - Standard timer function blocks
No.
Description
Graphical form
1
2a
2b
 a
3a
3b
 a
*** is: TP (Pulse)
TON (On-delay)
T---0 (On-delay)
TOF (Off-delay)
0---T (Off-delay)
+-------+
| *** |
BOOL---|IN Q|---BOOL
TIME---|PT ET|---TIME
+-------+
NOTE The effect of a change in the value of the PT input during the timing operation, e.g., the
setting of PT to t#0s to reset the operation of a TP instance, is an implementation-
dependent parameter
.
a
In textual languages, features 2b and 3b shall not be used.
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


– 82 –
61131-3 
 IEC:2003(E)
Table 38 - Standard timer function blocks - timing diagrams
Pulse (TP) timing
+--------+ ++ ++ +--------+
IN | | || || | |
--+ +-----++-++---+ +---------
t0 t1 t2 t3 t4 t5
+----+ +----+ +----+
Q | | | | | |
--+ +---------+ +--+ +-------------
t0 t0+PT t2 t2+PT t4 t4+PT
PT +---+ + +---+
: / | /| / |
ET : / | / | / |
: / | / | / |
: / | / | / |
0-+ +-----+ +--+ +---------
t0 t1 t2 t4 t5
On-delay (TON) timing
+--------+ +---+ +--------+
IN | | | | | |
--+ +--------+ +---+ +-------------
t0 t1 t2 t3 t4 t5
+---+ +---+
Q | | | |
-------+ +---------------------+ +-------------
t0+PT t1 t4+PT t5
PT +---+ +---+
: / | + / |
ET : / | /| / |
: / | / | / |
: / | / | / |
0-+ +--------+ +---+ +-------------
t0 t1 t2 t3 t4 t5
Off-delay (TOF) timing
+--------+ +---+ +--------+
IN | | | | | |
---+ +--------+ +---+ +-----------
t0 t1 t2 t3 t4 t5
+-------------+ +---------------------+
Q | | | |
---+ +---+ +------
t0 t1+PT t2 t5+PT
PT +---+ +------
: / | + /
ET : / | /| /
: / | / | /
: / | / | /
0------------+ +---+ +--------+
t1 t3 t5
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)
– 83 –
2.5.2.3.5 Communication function blocks
Standard communication function blocks for programmable controllers are defined in IEC 61131-5.
These function blocks provide programmable communications functionality such as device verification,
polled data acquisition, programmed data acquisition, parametric control, interlocked control,
programmed alarm reporting, and connection management and protection.
2.5.3 Programs
program is defined in IEC 61131-1 as a “logical assembly of all the programming language elements
and constructs necessary for the intended signal processing required for the control of a machine or
process by a programmable controller system.”
Subclause 1.4.1 of this part describes the place of programs in the overall software model of a
programmable controller; subclause 1.4.2 describes the means available for inter- and intra-program
communication; and subclause 1.4.3 describes the overall process of program development.
The declaration and usage of programs is identical to that of function blocks as defined in 2.5.2.1 and
2.5.2.2, with the additional features shown in table 39 and the following differences:
1) The delimiting keywords for program declarations shall be PROGRAM...END_PROGRAM.
2) A program can contain a VAR_ACCESS...END_VAR construction, which provides a means of
specifying named variables which can be accessed by some of the communication services
specified in IEC 61131-5. An access path associates each such variable with an input, output or
internal variable of the program. The format and usage of this declaration shall be as described in
2.7.1 and in IEC 61131-5.
3) Programs can only be instantiated within resources, as defined in 2.7.1, while function blocks can
only be instantiated within programs or other function blocks.
4) A program can contain location assignments as described in 2.4.3.1 and 2.4.3.2 in the
declarations of its global and internal variables. Location assignments with not fully specified direct
representation as described in 2.4.1.1 and 2.4.3.1 can only be used in the declaration of internal
variables of a program.
The declaration and use of programs are illustrated in figure 19, and in examples F.7 and F.8.
Limitations on the size of programs in a particular resource are implementation-dependent parameters.

Download 1.35 Mb.

Do'stlaringiz bilan baham:
1   ...   66   67   68   69   70   71   72   73   ...   158




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