Introduction
In an application the user chooses a name to:
define a type of data
instantiate a data item (symbol)
identify a Program Unit
identify a section
Some rules have been defined in order to avoid conflicts occurring. This means that it is necessary to differentiate between the different domains of application of data
What is a Domain?
It is an area of the application from which a variable can or cannot be accessed, such as:
the application domain which includes:
the various application tasks
the Program Units and/or sections of which it is composed
the domains for each data type such as:
structures/tables for the DDT family
EFB/DFBs for the function block family
Rules
This table defines whether or not it is possible to use a name that already exists in the application for newly-created elements:
Application Content -> New elements (below) |
Program unit |
Section |
SR |
DDT/IODDT |
FB type |
FB Instances |
EF |
Variable |
---|---|---|---|---|---|---|---|---|
Program Unit |
No |
No |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Section |
No |
No(5) |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
SR |
No |
No |
No |
Yes |
Yes |
No |
(1) |
No |
DDT/IODDT |
No |
No |
No |
No |
No(4) |
No |
No(4) |
No |
FB type |
Yes |
Yes |
Yes |
No |
No |
(3) |
No |
(3) |
FB Instances |
No |
No |
No |
No |
Yes |
No |
Yes |
No |
EF |
Yes |
Yes |
(2) |
No |
No |
No |
No |
No |
Variable |
Yes |
Yes |
No |
Yes |
Yes |
No |
(1) |
No |
(1) An instance belonging to the application domain cannot have the same name as an EF. (2) An instance belonging to the type domain (internal variable) can have the same name as an EF. The EF in question cannot be used in this type. (3) The creation or import of EFB/DFBs with the same name as an existing instance are prohibited. (4) An DDT/IODDT element might have the same name of an FB/EF, however in this case you could not use the FB/EF in the application. (5) Exception: there is no conflict between the name of a section belonging a program unit and the name of a section belonging to another program unit. |
Within a type, an instance (internal variable) cannot have the same name as the type name of the object to which it belongs,
There is no conflict between the name of an instance belonging to a section of the application and the name of the instance belonging to a section of a DFB,
There is no conflict between the name of a section belonging to a task and the name of the section belonging to a DFB.