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


Figure F.12 - Body of program AGV


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

 
Figure F.12 - Body of program AGV 
 
IEC 2512/02
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)
– 205 –
+-------+
¦ |
¦ +===+===+ (* Perform a single cycle *)
¦ |¦READY¦|
¦ +===+===+
¦ |
¦ + CYCLE
¦ |
¦ +---+---+ +-+---------+
¦ ¦FORWARD+-¦N¦FWD_MOTOR¦
¦ +---+---+ +-+---------+
¦ |
¦ + RIGHT_LS
¦ |
¦ +---+---+ +-+---------+
¦ ¦REVERSE+-¦N¦REV_MOTOR¦
¦ +---+---+ +-+---------+
¦ |
¦ + LEFT_LS
¦ |
¦ +--+-+
¦ ¦DONE¦
¦ +--+-+
¦ |
¦ + NOT CYCLE
¦ |
+-------+
Figure F.12 - Body of program AGV (continued)
IEC 2513/02
Copyright International Electrotechnical Commission 
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---


– 206 –
61131-3 
 IEC:2003(E)
F.9 Use of enumerated data types
The following example illustrates the use of enumerated data types in ST CASE statements and in
Instruction List. Suppose an enumerated data type has been defined by the following declaration:
TYPE SPEED: (SLOW, MEDIUM, FAST, VERY_FAST); END_TYPE
In addition, suppose an input and output of a function block type is declared by:
VAR_INPUT MOTOR_SPEED: SPEED; END_VAR
VAR_OUTPUT SPEED_OUT: SPEED; END_VAR
Then if the body of the function block type is defined in the ST language, a CASE statement such as
the following could be used:
CASE MOTOR_SPEED OF
SLOW: (* speed it up *);
MEDIUM: (* hold the current speed *);
FAST: (* slow it down *);
ELSE (* take special care *);
END_CASE;
If the body of the function block type is defined in the IL language, the following instructions could be
used:
LD SPEED#SLOW (* enumerated value qualified by data type *)
ST SPEED_OUT

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