Variables size [number of bytes]

Title short form

Variables size

Categories

Informative, efficiency

Definition

Size of the static memory used by the object

Further information

For function blocks, this is the size used for an instance of this function block (which may also contain memory gaps depending on the memory alignment). For programs, functions and global variable lists, this is the sum of the size of all static variables.

Sample:

FUNCTION F_Sample : INT
VAR_INPUT
    a,b   : INT;
END_VAR
VAR
    c,d   : INT;
END_VAR
VAR_STAT
    f,g,h : INT;
END_VAR

The function has three static variables of type INT (f, g, h), each of which requires 2 bytes of storage space. F_Sample therefore has a variable size of 6 bytes.