At a Glance

There are two types of DFB internal data:

  • The parameters: Input, Output or Input/Output.

  • Public or Private variables.

The internal data of the DFB must be defined using symbols (this data cannot be addressed as an address).

Elements to Define for Each Parameter

When the function block is created, the following must be defined for each parameter:

  • Name: Name of DFB type (max. 32 characters). This name must be unique in the libraries; the authorized characters used depend on the choice made in the Identifiers area of the Language extensions tab in Project Settings:

  • A type of object (BOOL, INT, REAL, etc.).

  • A comment of a maximum of 1024 characters (optional). Formatting characters (carriage return, tab, etc.) are not allowed.

  • An initial value.

  • The read/write attribute that defines whether the variable may or may not be written in runtime: R (read only) or R/W (read/write). This attribute must only be defined for public variables.

  • The backup attribute that defines whether the variable may or may not be saved.

Types of Objects

The types of objects that may be defined for the DFB parameters belong to the following families:

  • Elementary data family: EDT. This family includes the following object types: Boolean (BOOL, EBOOL), Integer (INT, DINT, etc.), Real (REAL), Character string (STRING), Bit string (BYTE, WORD, etc.), etc.

  • Derived data family: DDT. This family includes table (ARRAY) and structure (user or IODDT) object types.

  • Generic data families: ANY_ARRAY_xxx.

  • The function block family: FB. This family includes EFB and DFB object types.

Authorized Objects for the Different Parameters

For performances reasons, the addressing mode of the DFB parameters must be transferred by address for the following object families

  • Inputs

  • Inputs/Outputs

  • Outputs

The addressing mode of a Function Block element is linked to the element type. The addressing modes are passed by:

  • Value (VAL)

  • Relocation table entry (RTE)

  • Logical address: RTE+Offset (L-ADR)

  • Logical address and number of elements (L-ADR-LG)

  • IO channel structure (IOCHS)

For each of the DFB parameters, the following object families may be used with its associated addressing modes:

Object families

EDT

STRING

Anonymous or DDT array

DDT (1)

IODDT

GDT: ANY_ARRAY_x

FB

ANY...

Inputs

VAL

L-ADR-LG

L-ADR-LG

L-ADR

No

L-ADR-LG

No

L-ADR-LG

Inputs/outputs

L-ADR(2)

L-ADR-LG

L-ADR-LG

L-ADR

IOCHS

L-ADR-LG

No

L-ADR-LG

Outputs

VAL

VAL

L-ADR-LG

VAL

No

L-ADR-LG

No

L-ADR-LG

Public variables

VAL

VAL

VAL

VAL

No

No

No

No

Private variables

VAL

VAL

VAL

VAL

No

No

RTE

No

 

Key:

(1)

Derived data family, except input/output derived data types (IODDT).

(2)

Except for EBOOL-type static variables, with Quantum PLCs.