61131-3
IEC:2003(E)
– 71 –
Table 33 - Function block declaration and usage features
No.
Description
Example
1a
RETAIN qualifier on
internal variables
VAR RETAIN X : REAL ; END_VAR
1b
NON_RETAIN qualifier on internal
variables
VAR NON_RETAIN X : REAL ; END_VAR
2a
RETAIN qualifier on
output variables
VAR_OUTPUT RETAIN X : REAL ; END_VAR
2b
RETAIN qualifier on
input variables
VAR_INPUT RETAIN X : REAL ; END_VAR
2c
RETAIN qualifier on output variables
VAR_OUTPUT NON_RETAIN X : REAL ; END_VAR
2d
RETAIN qualifier on input variables
VAR_INPUT NON_RETAIN X : REAL ; END_VAR
3a
RETAIN qualifier on internal function blocks
VAR RETAIN TMR1: TON ; END_VAR
3b
NON_RETAIN qualifier on internal function blocks
VAR NON_RETAIN TMR1: TON ; END_VAR
4a
VAR_IN_OUT declaration (textual)
VAR_IN_OUT A: INT ; END_VAR
4b
VAR_IN_OUT declaration and usage(graphical)
See figure 12
4c
VAR_IN_OUT declaration with assignment to different variables (graphical)
See figure 12d
5a
Function block instance name as input
(textual)
VAR_INPUT I_TMR: TON ; END_VAR
EXPIRED := I_TMR.Q; (* Note 1 *)
5b
Function block instance name as input (graphical)
See figure 11a
6a
Function block instance name as
VAR_IN_OUT (textual)
VAR_IN_OUT IO_TMR: TOF ; END_VAR
IO_TMR(IN:=A_VAR, PT:=T#10S);
EXPIRED := IO_TMR.Q; (* Note 1 *)
Do'stlaringiz bilan baham: