Skip to main content

Section: MetaData

The section MetaData contains the description, category and icons (with size 16x16 pixel and 32x32 pixel).

SEC MetaData                                                                                                                                                                                                                                        //optional: yes, modifier: [UPDATE]]
    Desc := <description>;                   //optional: no, type: text
    Category := <category name>;             //optional: no, type: CategoryPath
    Icon_16 := <icon16 name>;                //optional: no, type: image
    Icon_32 := <icon32 name>;                //optional: no, type: image
    Inst_Prefix := <instance prefix>;        //optional: yes, type: IDOrNothing
    Default_Inst_Name := <instance name>;    //optional: yes, type: text
    Links := ['<link1>','<link2>',...]       //optional: Yes, type: UriCollection
END_SEC

Details regarding the syntax of definition types are described in the section Module Declaration.

. Specification:
  • If the section MetaData is missing, this module will be used as base module which cannot be instantiated.

  • Category defines a topic for modules belonging to the same subject. The character | creates a hierarchic structure of the elements in the "Add module" dialog. The characters | and newline or carriage return are not allowed in the structure names.

  • Icon_16 defines the name of the icon with resolution 16 x 16 pixels. The images for the icons must be defined in an image pool. The icon Icon_16 is used for the module tree and the icon Icon_32 for the information dialog.

  • Inst_Prefix defines the default prefix for the names of generated FB instances and submodule instances. Empty prefix (Inst_Prefix := ) are also possible, which however may cause a intersection with other variable names of the function block. This presetting can be overwritten in the section Slot.

  • If deriving from a module class with IMPORTS, the section MetaData must be updated if this section exists in the base module. To do this the section must be declared with the modifier UPDATE and the description must be redefined.

  • Default_Inst_Name can 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". If there is a default name of a parent slot, this name is preferred to the one in the meta data of the module

  • Links defines a list of links. The links are displayed in the module editor in the Information tab. The content of the first URL of link list is displayed in the Information tab.

Example 16. Example
SEC MetaData
        Desc := TL.Desc_Drives ;
        Category := 'Mechatronics'|'Drives' ;
        Icon_16 := IP.Drive_Icon_16 ;
        Icon_32 := IP.Drive_Icon_32 ;
        Default_Inst_Name := IDrive ;
        Links := ['file:///d:\Document1.pdf', 'https://www.codesys.com', 'mailto:info@codesys.com'];
END_SEC

Category := 'Mechatronics'|'Drives creates the following structure:

ac_CollectionCategory.png