Section: CFCCreation
This section contains all subsections that are interpreted by the CFC generator.
SEC cfc.CFCCreation SEC CreateCFCProgram : <CFC program identifier> //optional: yes, modifier [UPDATE] StandardCallTask := <Task type>; //optional: yes, type: ID CustomCallTask := <Task type>; //optional: yes, type: ID ParentFolder := <create folder ID; //optional: yes, type: ID END_SEC SEC CreateCFCModuleCall //optional: yes, modifier [UPDATE] PreferredCFCProgram := <CFC program> //optional: yes; type: FB type END_SEC SEC CreateCFCIOCall : <CFC IO call ID> // optional: yes; modifier [UPDATE] FB := <FB name>; // optional: no; type: FB type PreferredCFCProgram := <CFC program> // optional: yes; type: FB type FBInstanceBaseName := AInput; // optional: yes; type: identifier END_SEC SEC CreateFolder : <folder ID> //optional: yes, modifier [UPDATE] ParentFolder := <folder name>; //optional: yes, type: ID END_SEC END_SEC
Details regarding the syntax of definition types are described in the section Module Declaration.
Subsection: CreateCFCProgram
If a module declaration contains a section cfc.CFCCreation
including the subsection CreateCFCProgram
, a CFC program will be created for the assigned module type. The CFC program will be inserted below the target application of the next higher toplevel/decoupled parent module instance. The definition CustomCallTask
or StandardCallTask
can be used to define the task that calls the CFC program to be created.
The target of the section
CreateCFCProgram
identifies the CFC programs of this module type. Basically a module type can define and create several CFC programs for its module instance.A definition for
StandardCallTask
orCustomCallTask
must exist, but only one definition is allowed.For
StandardCallTask
the three IDsLOW
,MEDIUM
, andHIGH
are available to define the task of the next higher toplevel/decoupled parent module instance.For
CustomCallTask
all target IDs are available that are used in the respective custom task of the next higher toplevel/decoupled parent module instance.
In
ParentFolder
the target ID of theCreateFolder
section can be entered. Then the created CFC program is added in this sub subfolder (CreateFolder
).
Subsection: CreateCFCModuleCall
If a module declaration contains a section cfc.CFCCreation
including the subsection CreateCFCProgram
, a call of the module instance FB will be created for the assigned module type in the CFC program of the next higher parent module instance.
PreferredCFCProgram
defines the CFC program to be used if several program are available.
Subsection: CreateCFCIOCall
The section is used to mark I/Os of a module type or module declaration. For these I/Os FB instances of a defined type are created. Then calls of these FB instances are created within the CFC program.
The target of the
CreateCFCIOCall
section defines the module I/O ID for which a global I/O FB will be created. The created I/O FB will be called in a CFC program.FB
defines the type of function block which is globally instantiated and called for the I/O FB mentioned above.PreferredCFCProgram
defines the CFC program to be used if several program are available.FBInstanceBaseName
defines a "base name" which is used for the naming of the created I/O FBs. If the definition does not exist the name of the module instance is used for the base instance.
Subsection: CreateFolder
This section contains parameters to create subfolders below the AC_CFC_Programs
folder. Corresponding to this a ParentFolder
can be defined in the CreateCFCProgram
section. CFC programs are then generated in the directory which is created by the CreateFolder
section. Folders itself can define a ParentFolder
to specify further sub and sub-sub folders.
In
ParentFolder
the target ID of theCreateFolder
section can be entered. Then the created directory will be created in this subfolder (CreateFolder
).
SEC cfc.CFCCreation SEC CreateCFCProgram : Standard StandardCallTask := MEDIUM; ParentFolder := SubFolderUnderFolder; END_SEC SEC CreateFolder : SubFolderUnderFolder ParentFolder := SubFolder; END_SEC END_SEC