Section: Slots
This section defines the availability and the type of slots of modules in the module tree. Two different types of slots can be defined.
Slot
SEC Slots                                                   //optional: yes, modifier: [UPDATE]]
    SEC Slot : <slot identifier>                            //optional: yes, modifier [HIDE,UPDATE]
            Variable := <variable name>;                        //optional: no, type: InstancePath
            Role := <role name>;                                //optional: no, type: text
            Type := <slot type>;                                //optional: no, type: SlotType
            Inst_Prefix := <instance prefix>;                   //optional: yes, type: ID
            Optional := TRUE/FALSE;                             //optional: yes, type: BoolFlag
            Default_Inst_Name := <instance name>;               //optional: yes, type: text
            Pragmas := [<pragma1>, <pragma2>,...];              //optional: yes, type: Pragmalist
            RegularExpressionParameterId :=  <RegEx param ID>   //optional: yes, type: text
            SEC Default_Allocation :                            //optional: yes, modifier [UPDATE]
                    Module_Name := <default module ID>;             //optional: yes, type: ID
                    Instance_Name := <default name>;                //optional: yes, type: ID
                    NotDeletable := TRUE/FALSE                      //optional: yes, type: BoolFlag
                    SEC VisuEmbeddings                              //optional: yes, modifier [UPDATE]
                            Empty := TRUE/FALSE;                        //optional: yes, type: BoolFlag
                            SEC Embedding : <visu identigier>           //optional: yes, modifier [UPDATE]
                                    VisuName := <visu name>;                //optional: no, type: ID
                                    Target := <target name>;                //optional: yes, type: ID
                                    LinkId := <link ID>;                    //optional: yes, type: ID
                            END_SEC
                    END_SEC
                    SEC PageVisu                                    //optional: yes, modifier [UPDATE]
                            VisuName := <visu name>;                    //optional: yes, type: ID
                            TopLevelTap := TRUE/FALSE;                  //optional: yes, type: BoolFlag
                    END_SEC
                    SEC IOMappings                                  //optional: yes, modifier [UPDATE]
                            SEC Mapping : <mapping identifier>          //optional: yes, modifier [UPDATE]
                                    NoMapping := TRUE/FALSE;                //optional: yes, type: BoolFlag
                                    STExpression := <ST expression>;        //optional: yes, tye: ID/ST expression
                            END_SEC
                    END_SEC
                    SEC Parameters                                  //optional: yes, modifier [UPDATE]
                            SEC Param : <param identifier>              //optional: yes, modifier [UPDATE]
                                    Value := <value>;                       //optional: no, type: ID)
                            END_SEC
                    END_SEC
            END_SEC
    END_SEC
END_SECDetails regarding the syntax of definition types are described in the section Module Declaration.
- The section - Slotdefines a slot which allows 0 connection or 1 connection.
- The target of the section - Slotmust identify the parameter uniquely. As a result, there must not be two different slots (whether- Slotor- Slot_Multi) that have the same target. (Upper/lower case is irrelevant.)
- The definition - Variableis an input instance path relative to the module function block. The instance path may refer in all its components only to input variables (for structure instances also local variables). The type of the addressed variable must be an interface or a FB type. Two different slots must not use the same variable.
- Roledefines the role description of the slot.
- Typedefines the slot type. The connection type can have the following values:- SUBMODULE: Slot for submodule instances.
- REFERENCE: Slot for referenced submodule instances.
- DECOUPLED: Slot for "decoupled" module instances.- See also: Section: Decoupled 
 
- Inst_Prefixis a prefix which is used for the name of the generated FB variable. Empty prefix (- Inst_Prefix := ;) is also possible, but may create conflicts with other variable names of the function block. May only be specified for- SUBMODULEtype slots.
- Optionaldefines if it is allowed to leave the slot open or if it must be connected.
- Default_Inst_Namecan be used to define a default name for module instances being children of this slot. Each module which is added will get this name by default using text list entry defined by "Default_Inst_Name". The default name of the slot is preferred to the one of the modules meta data.
- Pragmascontains a list of compiler pragmas which are inserted before FB instances of the submodules. Pragmas may only be used for managed slots.
- RegularExpressionParameterIddefines a parameter of type STRING/WSTRING for this slot. The value of this parameter is interpreted as regular expression and it must match the name of the inserted submodule.
- The sections - Slot.Default_Allocationand- Slot_Multi.Default_Allocationallow to define default settings for slots with variable numbers of elements (Multi_Slots and Slots). For- Slots.Multi_Slotthey must be identified by unique targets whereas- Slots.Slothas not target and can only have one- Default_Allocationsection. The instance will be added depending on its position within the section. The module name and instance name follows the definition of- Slot.DefaultModuleand- Slot.DefaultName. If this definitions are not available the settings of- Default_Allocation.Module_Nameand- Default_Allocation.Instance_Namewill be used. It is recommended to use- Default_Allocation.*for slots instead of- DefaultModuleand- DefaultNamewhich only exists for compatibility reasons. The settings of the default module instance can be defined in the subsections of- Default_Allocation:- Module_Namedefines the name of the module of which an instance will be created automatically. If the module comes from a library, the module name must be qualified with namespace. The parameter is only allowed for slots of type- SUBMODULE.- Infinite calls are not allowed and will create an error message (example: declaration of module "A" contains default module "B"; declaration of module "B" contains default module "A"). 
- Instance_Namemust be specified whenever- DefaultModuleis specified, and never otherwise. It must be a valid IEC identifier which is used as the name of the default module instance. The name must not begin or end with an underline (- _). The default names of all slots of a declaration must be unique. (Case sensitivity makes no difference.)
- NotDeletablespecifies whether or not the module can be deleted by the user. If- TRUE, then the module cannot be deleted. An error message is displayed. If the parameter is- FALSEor it is omitted, then the module can be deleted.
- VisuEmbeddings: If the- Emptyparameter is set to- TRUE, then an empty list of embedded visus is created for this module instance. If the value is- FALSE, then the desired list of embedded visualizations can be generated for the module instance via the listing of desired embedded visualizations in the- Embeddingsubsection. Each- Embeddingsection must define the name- VisuNameof the desired embedded visu for this purpose and can specify additional properties such as- Targetor- LinkIdof this embedded visu.
- PageVisu: In this section the PageVisu of the module instance can be chosen (- VisuName). Furthermore it can be defined if this visu creates a- TopLevelTap. The parameter- TopLevelTaphas to be given the values- TRUEand- FALSE.
- IOMappings: In the subsection- Mappingthe I/O channels can be defined. The targets of the sections- Mappingdescribe the target I/O channel. The default can be set to- NoMappingor to an- STExpression.
- Parameters: In the subsection- Paramthe value- Valueof each parameter which is defined in the target of the section can be defined.
 
Slot_Multi
By use of the section Slot_Multi a list of subinstances and references can be created.
SEC Slots                                                   //optional: yes, modifier: [UPDATE]]
    SEC Slot_Multi : <slot name>                            //optional: yes, modifier [HIDE,UPDATE]
            Variable := <variable name>;                        //optional: no, type: InstancePath
            Var_Count := <variable for count>;                  //optional: no, type: InstancePath
            Role := <name role>;                                //optional: no, type: text
            Cardinality := [<minimum> .. <maximum>];            //optional: no, type: Cardinality
            Type := <slot type>;                                //optional: no, type: SlotType
            Inst_Prefix := <instance prefix>;                   //optional: yes, type: ID
            Pragmas := <pragma list>;                           //optional: yes, type: Pragmalist
            Default_Inst_Name := <instance name>;               //optional: yes, type: text
            RegularExpressionParameterId :=  <RegEx param ID>   //optional: yes, type: text
            SEC Default_Allocation :                            //optional: yes, modifier [UPDATE]
                    Module_Name := <default module ID>;             //optional: yes, type: ID
                    Instance_Name := <default name>;                //optional: yes, type: ID
                    NotDeletable := TRUE/FALSE                      //optional: yes, type: BoolFlag
                    SEC VisuEmbeddings                              //optional: yes, modifier [UPDATE]
                            Empty := TRUE/FALSE;                        //optional: yes, type: BoolFlag
                            SEC Embedding :  <visu identifier>          //optional: yes, modifier [UPDATE]
                                    VisuName := <visu name>;                //optional: no, type: ID
                                    Target := <target name>;                //optional: yes, type: ID
                                    LinkId := <link ID>;                    //optional: yes, type: ID
                            END_SEC
                    END_SEC
                    SEC PageVisu                                    //optional: yes, modifier [UPDATE]
                            VisuName := <visu name>;                    //optional: yes, type: ID
                            TopLevelTap := TRUE/FALSE;                  //optional: yes, type: BoolFlag
                    END_SEC
                    SEC IOMappings                                  //optional: yes, modifier [UPDATE]
                            SEC Mapping :  <mapping identifier>;        //optional: yes, modifier [UPDATE]
                                    NoMapping := TRUE/FALSE;                   //optional: yes, type: BoolFlag
                                    STExpression := <ST expression>;        //optional: yes, tye: ID/ST expression
                            END_SEC
                    END_SEC
                    SEC Parameters                                  //optional: yes, modifier [UPDATE]
                            SEC Param :  <param identifier>             //optional: yes, modifier [UPDATE]
                                    Value := <value>;                       //optional: no, type: ID)
                            END_SEC
                    END_SEC
            END_SEC
    END_SEC
END_SEC- Var_Countdefines the input instance path of the module function block. This variable (of type Integer) will save the information about the number of instances connected to the slot.
- Cardinalitydefines the minimum and maximum number of instances.
- The - Slot_Multi.Default_Allocationsection can be used to define default allocations for slots with variable number of elements. They must be identified via unique targets. The instances are inserted in the order of the sections. For the module name and instance name, the specifications for- Slot.DefaultModuleor- Slot.DefaultNameapply. The number of default assignments must not exceed the upper digit.
- The variable addressed by a - Slot_Multisection must be of type- POINTER TO <INTERFACE>.
- Each input variable of type integer can be addressed by - Var_Countonly once. (This also includes- InstRef_Multi.Var_Countand- VarArray.Var_Count).
SEC Slot
        SEC Slot_Multi : subs
                Variable := pSubs;
                Var_Count := uiArraySize;
                Role := TL.Role;
                Cardinality := [2 .. 17];
                Type := SUBMODULE;
                RegularExpressionParameterId := Param_RegEx_Ref;
                SEC Default_Allocation : def1
                        Module_Name   := Sub1;
                        Instance_Name := Submodule;
                END_SEC
                Name := TL.Input1_Name;
                Desc := TL.Input1_Desc;
        END_SEC
END_SECAmong other declarations the declaration part of the function block must contain: uiArraySize: UINT; pSubs: POINTER TO ITestModule.
In the example, a slot is defined that holds at least 2, but at most 17 subinstances. An array will be created for the subinstances and pSubs points to it. When adding the instance the submodule with name Submodule of type Sub1 will be added automatically to the slot.