The interface section has the following syntax:
// Interface statements (optional)
An individual identifier of the section cannot be specified.
Optionally, interface statements exist in the following order between reserved words INTERFACE and END_INTERFACE.
声明使用的工艺包Specification of utilized technology package. Syntax:
USEPACKAGE tp-name [AS namespace];
For more details, refer to the SIMOTION Basic Functions Function Manual.
声明库Specification of utilized libraries.
USELIB library-name-list [AS namespace];
For more information, see "Using data types, functions and function blocks from libraries".
引用的其他部分Reference to other units in order to use their public components.
The syntax is:
For more information, see "USES statement in a using unit".
Declarations and information regarding declaration as public to other program sources:
User-defined data types (UDT) that are public and valid within the entire ST source file
Unit variables and unit constants that are public and valid within the entire ST source file.
Permissible keywords: See Section "Variable declaration".
Object-oriented interfaces that are public and valid within the entire ST source file.
As of version V4.5 of the SIMOTION Kernel and with compiler option “Permit object-oriented programming” enabled.
Object-oriented interfaces utilize the same keywords as the interface section (INTERFACE / END_INTERFACE).
Specification of the program organization units (POUs) to be declared public.
CLASS class_name; (as of version V4.5 of the SIMOTION Kernel and with compiler option "Permit object-oriented programming” enabled)
POU prototypes for the forward declaration.
Specification of the prototypes for program organization units with forward declaration (only effective if the "Permit forward declarations" compiler option is activated).
They are also interpreted as POUs to be exported.
All technology packages, libraries, units used, data type declarations, variable declarations, object-oriented interfaces and program organization units listed in the interface section are declared public. For further information about declaring public, see "Interface section of a unit with Declare Public function".
The interface section is the first section of an ST source file.
Optionally, the unit statement can precede the interface section, see "Identifier of the unit".
The order of the interface statements 1 to 4 is fixed.
Within number 4, any order is permitted. The individual declaration blocks for data type definitions (including POU prototypes) and variables declarations can appear more than once.
Please note: Identifiers must be declared before they are used.
Only if the "Permit forward declarations" compiler option is activated: When declaring an instance of a function block or a class, it is sufficient for the prototype of the function block to have been declared beforehand. It is not possible to initialize the function block or the class.
Once per ST source file