Siemens TOA portal module 040-020 manual Expanding the program

Page 26

Industry Sector, IA&DT

5.4Expanding the program

Next, we will check whether faulty information is contained in the input parameters of the

'calculate_tankcontent' block. Another value 'high_max' is also passed to the block. This indicates the height of the tank.

The block is now to analyze whether the fill-level of the tank is less than zero or greater than the specified tank height. It is also to be checked whether the diameter was specified as less than zero.

If there is an error, the Boolean output parameter 'er' should return TRUE and the value of the 'Content' parameter should be -1.

Expanding the assignment list / tag table:

Address

Symbol

Data type

Comment

%Q1.7

Error bit

BOOL

Error, unable to perform calculation

Expansion of the interface of the function FC140:

calculate_tankcontent

Type

Symbol

Data type

Comment

 

IN

high_max

REAL

in meters

 

OUT

er

REAL

er = 1, there is an error, content = -1

Function call: Representation in FBD

FC140

calculate_tankcontent

Fill level:

REAL

high_max: REAL

Diameter: REAL

BOOL :er

REAL :content

SCE Training Curriculum

Page 26 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

 

 

 

 

Image 26
Contents TIA Portal Module Suitable SCE trainer packages for these training curriculums Industry Sector, IA&DT Learning objective RequirementsRequired hardware and software Industry Sector, IA&DT Debugger S7-SCL for S7-300/400Editor / compiler Assignment list / tag table Default tag tableDescription of task Structure of the tank content sample task Program structureInterface of the block calculatetankcontent FC140 Type Designation FunctionInterface of the function FC140 Calculatetankcontent Function call Representation in FBDCreating a project and configuring hardware Industry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT Creating a program Industry Sector, IA&DT Diagram Industry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT Test program Industry Sector, IA&DT Mode on. → Expanding the program Expanding the assignment list / tag tableIndustry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT