Attribute 'pingroup'

The pragma causes the input or output pins (parameters) to be grouped together in the declaration of a function block. In the FBD/LD editor a pin group defined in this way can then be displayed as a unit in collapsed or expanded form at the added function block. Several groups are possible and are distinguished through their names. TwinCAT stores the corresponding state (collapsed) for each function block box with the project.

Syntax: {attribute 'pingroup' := '<group name>'}

Insertion location: Row above the declaration of the affected input or output variable in the declaration part of a function block.

Sample:

Function block FB_Sample:

FUNCTION_BLOCK FB_Sample
VAR_INPUT
    f1 : REAL;
    {attribute 'pingroup' := 'general'}
    n1 : INT;
    {attribute 'pingroup' := 'group1'}
    n2 : INT;
    f2 : REAL;
END_VAR
VAR_OUTPUT
    fOutRes1 : REAL;
    {attribute 'pingroup' := 'general'}
    nOut1 : INT;
    {attribute 'pingroup' := 'group1'}
    nG1 : INT;
    fG2 : REAL;
END_VAR

Program SampleProg:

PROGRAM SampleProg
VAR
    fbSample : FB_Sample;
END_VAR

In the presentation of the function block instance fbSample, the pragmas cause the following grouping of the input and output pins:

Attribute 'pingroup' 1:

See also: