Section: SourceTemplate
The subsections of section SourceTemplate defines the function blocks to be copied into the project.
In the module editor the here-defined function blocks get listed. There you can activate or deactivate the copying.
SEC std.SourceTemplate
SEC SourceFB : <Identifier> // optional: no
SourceType := <FunctionBlock>; // optional: no, type: InstancePath
Variable := <variable name>; // optional: no, type: InstancePath
Default := TRUE/FALSE; // optional: yes, type: Bool Flag
IsMandatory := TRUE/FALSE; // optional: yes, type: Bool Flag
FBVariable := <variable name>; // optional: yes, type: InstancePath
DestinationType := <default name>; // optional: yes, Type: String/Literal
END_SEC
END_SECDetails regarding the syntax of definition types are described in the section Module Declaration.
The
Identifieris used in the module editor. It defines the name of the copied function block ifDestinationTypeis not defined.SourceTypedefines the function block to be copied.Variabledefines an input variable of the module function block. It must be a pointer to a basic class of the copied function or an interface, which is implemented by the function block to be copied.Defaultdefines if the function block is copied by default for this module. If the definition is missing,TRUEis set. This option can be adjusted in the module editor.If
IsMandatoryis set toTRUE, the user cannot change theIsToCopyoption in the module editor.FBVariabledefines an input variable of the function block to be copied. The input variable is then instantiated with the module instance. The type of the input is a pointer to a basis type of the module FB or a pointer to the interface of the module FB.DestinationTypedefines a standard name for the copied function block. If the definition is missing the following naming convention is used: <Name ofthemodule instance>_<Identifier>[_<consecutive number>].
The specified SourceTemplates are copied to the AC_SourceTemplate folder. They are instantiated and initialized by the assigned module FB. SourceTemplates, once created, can be edited and will not be overwritten by renewed generator runs. SourceTemplates, which are no longer required, get renamed (with the <_unused> suffix) and moved to the <UnusedSourceTemplates> folder.
SEC std.SourceTemplate
SEC SourceFB : ID_ConnectSwitches
SourceType := ConnectSwitches;
Variable := itfConnect;
FBVariable := pBuilding;
Default := TRUE;
IsMandatory := FALSE;
DestinationType := 'TypeInModuleDescription';
END_SEC
END_SEC