The resources of CoDeSys fragments must have the following structure:
FRAGMENT <FragmentName>
<Variablendeklaration>
(*@END_DECLARATION*)
<FragmentCode>
END_FRAGMENT
- FragmentName:
When creating a new discipline component, this name is used as the name of the new component when the resource is read in.
- Variable declaration (optional):
Can be used to declare variables that can be added into a different component by means of control structures (e.g., (e.g., (*{TempVariableDeclaration}*)). The declaration must not contain any comments.
- FragmentCode (optional):
Designates an arbitrary text that is located between the line marked with (*@END_DECLARATION*) and the line END_FRAGMENT. This complete text can be added into other components by means of the control structure (*{Code}*).
FRAGMENT CallingFragment
VAR
In1:BOOL;
In2:BOOL;
END_VAR
(* @END_DECLARATION*)
This text can be inserted as code
END_FRAGMENT