Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 8846287, Entry date: 11/28/2001

Parameterizable level control

  • Entry
  • Associated product(s)

Where can I find an example of level control that can be parameterized via SIMATIC Standard PID Control?

In the sample program available here for downloading you can run a level control and parameterize it via SIMATIC Standard PID Control. Controlling here is done via the time interrupt OB35 that contains the sample program "APP_Level_Control" (FC 100). This program is called by the OB35 in equidistant time slices. In the case of a cold/warm restart the initialization of the line parameters and the calling of the "APP_Level_Control" program is done in the OB100 (startup OB). Stored in the data blocks DB98 and DB101 are the setpoint values, actual values and manipulated variable values, control parameters, control functions etc. Proceed as follows to start the sample program on your CPU:

With the SIMATIC Manager

  • Open your project or create a new one (hardware configuration).
  • On this side open the downloaded sample project "Level Control" and copy the S7 program folder into the station of your project.
  • Open the library "StdCon (V5)" and copy function block FB1 "PID_CP" into the program of your project. This function block contains the control program.
  • Please make sure you have the OB1 organization block in your project. If not, then create a blank OB1 organization block (to avoid error messages).

Testing the sample program:

  • Load the project into the CPU.
  • Open the configuration tool "Parameterize Standard PID Control". You can get to this in the Windows interface via "Start > STEP 7 > Parameterize Standard PID Control".
  • Put the CPU into operating mode "RUN-P"
  • Open the sample project "Level Control" in "Parameterize Standard PID Control". Open data block DB101 online.

The block diagram and the control parameters should be configured as in Figure 1.


Figure 1: Block diagram

  • Double-click the PID icon to open the mask for parameterizing the controller (Figure 2).


Figure 2: Input of control parameters

To test the sample program you now select the menu item "Test > Loop Display and Test > Plotter". In the loop display you enter a setpoint value jump of 50% and observe the reaction on the plotter. With the controller setting given in Figure 2 you should have a curve as shown in Figure 3.


Figure 3: Curves (setpoint, actual and manipulated variable values)

This setpoint value jump can also be realized via the variable table VAT1 in the project. For this you enter the control value (e.g. 50) in the setpoint value cell(DB101.DBD 322) and then update with "Control variable". The Bool value for "SP_OP_ON" must be set to "TRUE" here and the two other Bool values "PV_OP_ON" and "LMNOP_ON" must be predefined to "FALSE".

Hardware and software requirements

  • S7-300 or S7-400 station consisting of a power supply module and a CPU (at least CPU314).
  • STEP 7 (version >= V4.02) is correctly installed on your PG.
  • A project has been created for the S7 station.
  • PG is connected to the CPU.
  • Software product "Standard PID Control FB" (function blocks) and the associated parameterization software "Standard PID Control Tool" are installed.
  • You are familiar with the STEP 7 programming packet, in particular the SIMATIC Manager and the LAD/FBD/STL editor.

Complete overview and a detailed introduction to the topic of "Controlling with SIMATIC S7 and PCS 7" is available in the book entitled "Controlling with SIMATIC" by Jürgen Müller (Publicis MCD Verlag, Erlangen und München, 2000).

The download contains function FC100 described above, function block FB98, data blocks DB98 and DB101 as well as the organization blocks OB35 (interrupt alarm) and OB100 (startup). To ensure controller functionality you must also copy controller function block FB1, that you received with the software product "Standard PID Control FB", into your project. The project has been created with STEP 7 V5.0 SP1 and "Standard PID Control Tool/FB V5.0.1".


Copy the "levelreg.exe" file into a separate directory and then start the file with a double-click. The STEP 7 V5.0 SP1 project then unpacks automatically with all the associated subdirectories. You can then use the SIMATIC Manager to open and process the unpacked project.

Level control, Inflow control, Outflow control

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit