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


Table 16 a) - Variable declaration keywords


Download 1.35 Mb.
Pdf ko'rish
bet34/158
Sana17.06.2023
Hajmi1.35 Mb.
#1528208
1   ...   30   31   32   33   34   35   36   37   ...   158
Bog'liq
ourdev 569653

Table 16 a) - Variable declaration keywords
a
The CONSTANT qualifier shall not be used in the declaration of function block instances as
described in 2.5.2.1.
b
The RETAIN and NON_RETAIN qualifiers may be used for variables declared in VAR,
VAR_INPUT, VAR_OUTPUT, and VAR_GLOBAL blocks but not in VAR_IN_OUT blocks and
not for individual elements of structures.
c
Usage of RETAIN and NON_RETAIN for function block and program instances is allowed.
The effect is that all members of the instance are treated as RETAIN or NON_RETAIN,
except if:
- the member is explicitly declared as RETAIN or NON_RETAIN in the function block or
program type definition;
- the member itself is a function block.
d
Usage of RETAIN and NON_RETAIN for instances of structured data types is allowed. The
effect is that all structure members, also those of nested structures, are treated as RETAIN
or NON_RETAIN.
e
Both RETAIN and NON_RETAIN are features. If a variable is neither explicitly declared as
RETAIN nor as NON_RETAIN the “warm start” behaviour of the variable is implementation
dependent
.
Within function blocks and programs, variables can be declared in a VAR_TEMP...END_VAR
construction. These variables are allocated and initialized at each invocation of an instance of the
program organization unit, and do not persist between invocations.
The scope (range of validity) of the declarations contained in the declaration part shall be local to the
program organization unit in which the declaration part is contained. That is, the declared variables
shall not be accessible to other program organization units except by explicit argument passing via
variables which have been declared as inputs or outputs of those units. The one exception to this rule
is the case of variables which have been declared to be global, as defined in 2.7.1. Such variables
are only accessible to a program organization unit via a VAR_EXTERNAL declaration. The type of a
variable declared in a VAR_EXTERNAL block shall agree with the type declared in the VAR_GLOBAL
block of the associated program, configuration or resource.
It shall be an error if:
• any program organization unit attempts to modify the value of a variable that has been declared
with the CONSTANT qualifier;
• a variable declared as VAR_GLOBAL CONSTANT in a configuration element or program
organization unit (the “containing element”) is used in a VAR_EXTERNAL declaration (without the
CONSTANT qualifier) of any element contained within the containing element as illustrated below.
The maximum number of variables allowed in a variable declaration block is an implementation-
dependent
parameter.
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)
– 41 –

Download 1.35 Mb.

Do'stlaringiz bilan baham:
1   ...   30   31   32   33   34   35   36   37   ...   158




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