Siemens TOA portal module 040-020 사용자 설명서

다운로드
페이지 30
 
 
 
Industry Sector, IA&DT 
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 
 
4.3 
Program 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].