FBs and FCs are used in Siemens S7 programming to define functions that can be executed on demand from an organization block. FBs and FCs are similar to subroutines and can simplify programming where the same task is needed multiple times within the program.
In this course, practical control examples will be used to demonstrate the use of these functions and function blocks. An FC block will be configured to calculate the level in a tank with a trapezoidal bottom. Input and output parameters will be configured to allow the FC to be used as a subroutine to calculate the level in three parallel tanks.
To demonstrate the use of a Function Block, two different examples will be developed. First, an FB will be used to monitor and control an on-off valve, including driving the valve output, monitoring the valve position feedback, and developing a command disagree alarm if the valve state does not match the commanded state after a time delay.
The second example will demonstrate a more complex use of an FB using a Data Block to support the execution of the FB logic. A DRUM sequencer will be configured in the FB to control a simple process as it progresses in a stepwise fashion.