Industry Sector, IA&DT
SCE Training Curriculum Page 8 of 30 To be used only at Educational and R&D Facilities
TIA Portal Module 040-020, Edition 03/2013 Unrestricted / © Siemens AG 2013. All Rights Reserved
SCE_EN_040-020_R1209_Startup Programming in High-Level Languages with S7-SCL and SIMATIC S7-300
4. Example Task Tank Content
4.1 Description of task
Our first program is one to program the calculate the content of tank.
The tank has the shape of an upright cylinder. The fill level of the content is measured by an analog
sensor. In the task, the value of the fill level should already existed standardized in the meter unit.
A function FC 140 'calculate_tank content' is to be programmed in the program. The diameter and the fill
level in meter unit are the passed parameters. Result is the tank content in the liter unit.
4.2 Assignment list / tag table
Because modern programming uses tags and not absolute addresses, the global PLC tags must be
defined here.
These global PLC tags are descriptive names with a comment for each input and output used in the
program. The global PLC tags can then be accessed later during programming via their names.
These global tags can be used in all blocks anywhere in the program.
Default tag table
Name
Data type
Address
Comment
FillLevel_tank1
REAL
%MD40
in meters
Diameter_tank1
REAL
%MD44
in meters
Content_tank1
REAL
%MD48
in liters