Siemens TOA portal module 040-020 Program structure, Structure of the tank content sample task

Page 9

Industry Sector, IA&DT

4.3Program structure

Program execution is written in what are referred to as blocks. The Main [OB1] organization block is provided as default. This block represents the interface to the CPU operating system and is automatically called and cyclically processed by this operating system.

From this organization block, additional blocks can be called in turn for structured programming, such as the function calculate_tankcontent [FC140]

This function is used to break an overall task down into subtasks. These can then be solved more easily and tested in their functionality.

Structure of the tank content sample task

Main organization block [OB1]

Block called cyclically by the operating system. Here is the call of the function calculate_tankcontent [FC140]

Function:

calculate_tankcontent [FC140]

The actual program is contained in this example.

Is called by Main [OB1].

SCE Training Curriculum

Page 9 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 9
Contents TIA Portal Module Suitable SCE trainer packages for these training curriculums Industry Sector, IA&DT Requirements Learning objectiveRequired hardware and software Industry Sector, IA&DT S7-SCL for S7-300/400 Editor / compilerDebugger Default tag table Description of taskAssignment list / tag table Program structure Structure of the tank content sample taskType Designation Function Interface of the block calculatetankcontent FC140Function call Representation in FBD Interface of the function FC140 CalculatetankcontentCreating 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 assignment list / tag table Expanding the programIndustry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT Industry Sector, IA&DT