2 function blocks, Function blocks, The software model – Lenze DDS v2.0 User Manual

Page 7

Advertising
background image

Introduction to IEC 61131-3 programming

The software model

5

l

DDS-IEC61131 EN 2.0

2.2.2

Function blocks

The IEC 61131-3 standard uses standard functions and function blocks to standardize typical PLC
functions. This ” Standard library” is an important basis for uniform, manufacturer-independent
programming of PLC systems.

Function blocks (FBs) can be compared with integrated circuits, which include a certain control
function. They are used to set inputs/outputs and internal variables. The status of a function block
request is saved from cycle to cycle. Only the input and output variables of the function can be
addressed by the request program. A function block can also be called by another function block.

Instancing of function blocks

IEC 61131-3 provides the instancing of function blocks. An instance is a structure which saves all
internal input and output variables when a function block is called.

A program which calls FB1 three times has three instances of FB1, one for each call. The program
can thus be evaluated precisely on request and without any side effects. Please observe that all
instances use the same program code, i.e. changes of the program code have the same effect on
al three requests.

Software tools like the Drive PLC Developer Studio help instancing by means of an automatic
declaration: An instance name is specified for an FB call. This name manages the data structure of
the call.

Overview: IEC 61131-3 standard function blocks

Bistable function blocks
SR/RS

Bistable function block (dominant set/reset)

SEMA

Software semaphore (interruptable)

Signal detection
R_TRIG/F_TRIG

Detector of rising/falling signals

Counters
CTU/CTD

Up-counter/down-counter

CTUD

Up and down counter

Timers
TP

Pulse encoder

TON/TOF

Timer on-delay/timer off-delay

Show/Hide Bookmarks

Advertising