Beckhoff Automation GmbH & Co. KG TX1200 — 2.1 Project Components

A Brief Introduction to TwinCAT PLC Control In SFC function block calls can only take place in steps. Program A program is a POU which returns several values during operation. Programs are recognized globally throughout the project. All values are retained from the last time the program was run until the next. Programs can be called. A program call in a function is not allowed. There are also no instances of programs. If a POU calls a program, and if thereby values of the program are changed, then these changes are retained the next time the program is called, even if the program has been called from within another POU. This is different from calling a function block.

There only the values in the given instance of a function block are changed. These changes therefore play a role only when the same instance is called. A program declaration begins with the keyword PROGRAM and ends with END_PROGRAM. Examples of calls of the program described above: In IL: CAL PRG Example LD PRGexample.PAR ST ERG in ST: PRGExample; Erg := PRGexample.PAR; In FBD: If the variable PAR from the program PRGexample is initialized by a main program with 0, and then one after the other programs are called with above named program calls, then the ERG result in the programs will have the values 1, 2, and 3.

If one exchanges the sequence of the calls, then the values of the given result parameters also change in a corresponding fashion. TX1200 14 Version: 1.3