Glossary

BOOL

Variables of the type BOOL can have the values TRUE and FALSE. For this, 8 bit of memory space are reserved.

BYTE

BYTE belongs to the integer data types. The different numerical types are responsible for a different numerical range.

For integer data types the following range limits are valid:
TYPE BYTE
Lower limit 0
Upper limit 255
Memory space 8 bits

Due to this, it is possible that information are lost when converting greater data types to smaller data types.

DINT

DINT belongs to the integer data types. The different numerical types are responsible for a different numerical range.

For integer data types the following range limits are valid:
TYPE DINT
Lower limit -2147483648
Upper limit 2147483647
Memory space 32 bits

Due to this, it is possible that information are lost when converting greater data types to smaller data types.

DWORD

DWORD belongs to the integer data types. The different numerical types are responsible for a different numerical range.

For integer data types the following range limits are valid:\
TYPE DWORD
Lower limit 0
Upper limit 4294967295
Memory space 32 bits

Due to this, it is possible that information are lost when converting greater data types to smaller data types.

INT

INT belongs to the integer data types. The different numerical types are responsible for a different numerical range.

For integer data types the following range limits are valid:
TYPE INT
Lower limit -32768
Upper limit 32767
Memory space 16 bits

Due to this, it is possible that information are lost when converting greater data types to smaller data types.

WORD

WORD belongs to the integer data types. The different numerical types are responsible for a different numerical range.

For integer data types the following range limits are valid:
TYPE WORD
Lower limit 0
Upper limit 65535
Memory space 16 bits

Due to this, it is possible that information are lost when converting greater data types to smaller data types.

Functions

Functions are subroutines which have multiple input parameters and return exactly one result element. The returned result can be of an elementary or a derived data type. Due to this, a function may also return an array, a structure, an array of structures and so on. For the same input parameters, functions always return the same result (they do not have an internal memory).

Therefore, the following rules can be derived:

  • Within functions, global variables can neither be read nor written.
  • Within functions, absolute operands can neither be read nor written.
  • Within functions, function Function Blocks must not be called.

Function Blocks

Function Blocks are subroutines which can have as many inputs, outputs and internal variables as required. They are called from a program or from another Function Block. As they can be used several times (with different data records), Function Blocks (code and interface) can be considered as type. When assigning an individual data record (declaration) to the Function Block, a Function Block instance is generated. In contrast to functions, Function Blocks can contain statically local data which are saved from one call to the next. Therefore e.g. counters can be realized which may not forget their counter value. I.e. Function Blocks can have an internal memory.

Functions and Function Blocks differ in two essential points:

  • A Function Block has multiple output parameters, a function only one. The output parameters of functions and Function Blocks differ syntactically.
  • In contrast to a function, a Function Block can have an internal memory.

Function Blocks with historical values (memory)

For Function Blocks with historical values it has to be observed that instance names may not be defined several times if different data sets should be called.

Function Blocks without historical values (memory)

For Function Blocks without historical values only one instance has to be defined for the Function Block type. This instance can be used for several calls of the Function Block (also with different I/O values).