Detailed Explanation of Siemens PLC Structured Programming

Detailed Explanation of Siemens PLC Structured Programming
Search on WeChat
Detailed Explanation of Siemens PLC Structured Programming
Technical Training
As a professional in the automation industry, you should have heard of structured programming to some extent. So, what is structured programming? It is the process of breaking down complex automation tasks into smaller, reusable sub-tasks that correspond to process functions, making it easier to handle and manage these complex tasks. These sub-tasks are represented as blocks in the user program. Therefore, each block is an independent part of the user program.
When programming PLCs, we commonly use linear programming, modular programming, and structured programming. Linear programming only uses a main program, and all program instructions are executed within the main program, suitable for small automation projects.
Modular programming divides an automation project into different functional modules, such as manual, automatic, and alarm functions. These different functions are then called by the main program. Structured programming is somewhat similar to modular programming as it also uses multiple sub-programs, but structured programming makes certain repetitive tasks into reusable program blocks for easy portability. To intuitively understand the differences between these three programming methods, below is an example of the start/stop control of two assembly lines. The hardware signal table is shown in Table 1:

Table 1: IO Signal Table

Detailed Explanation of Siemens PLC Structured Programming

01
Linear Programming
Detailed Explanation of Siemens PLC Structured Programming

In linear programming, all programs are in OB1, as shown in Figure 1:

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 1 Linear Programming

02
Modular Programming
Detailed Explanation of Siemens PLC Structured Programming

In modular programming, the two assembly lines are called in different sub-programs, as shown in Figures 2 and 3:

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 2 Main Program Calling Sub-Program

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 3 Assembly Line 1 Executing Program

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 4 Assembly Line 2 Executing Program

03
Structured Programming
Detailed Explanation of Siemens PLC Structured Programming

Structured programming is achieved by establishing FB program blocks, with internal functions implemented within the FB. This FB block can be reused, and when calling the FB program block, the corresponding DB data block is automatically generated. When controlling the program, only specific pins need to be defined. The specific structured programming is shown in the figure below:

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 5 OB1 Program Call

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 6 Assembly Line 1 Program

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 7 Assembly Line 2 Program

Detailed Explanation of Siemens PLC Structured Programming

▲ Figure 8 Background Block of Assembly Line Function

Summary

In the previous text, the start/stop control of two assembly lines was illustrated using different programming methods.

Each programming method has been understood to a certain extent. Since the example programs are relatively simple, the advantages and disadvantages of the programs are not so obvious. However, as the complexity of the project increases, the workload of programming becomes larger, and the advantages of structured programming become more apparent. Its readability and reusability can improve work efficiency. In the process of PLC programming, it is recommended to use a hybrid programming method of structured and modular programming.

HISTORY
/
Previous Recommendations

Complete question bank for the 2022 junior electrician exam (including answers)

3 essential tools for electricians, easily accessible via WeChat!

[Bookmark] The “path” for a ten-year veteran electrician, the secret to earning over ten thousand a month!

Which of the five major electrical drawing software (CAD, Eplan, CADe_simu…) do you choose?

The latest CAD drawing software for electrical engineering, with a super detailed installation tutorial!

The latest electrical drawing software EPLAN, with a super detailed installation tutorial!

Common problems for beginners using S7-200 SMART programming software (with download link)

Comprehensive electrical calculation EXCEL spreadsheet, automatically generated! No need to ask for electrical calculations!

Free Bluetooth headphones and introductory books for electricians/PLC? Come and claim your electrical gift!

Fundamentals of PLC programming: Ladder diagrams and control circuits (with 1164 practical examples of Mitsubishi PLC)

Still can’t understand electrical diagrams? Basic electrical drawing skills and simulation software available for quick hands-on practice!

12 free electrician video courses, 10GB of software/e-books, and 30 days of free live electrician courses!

Don’t forget to like + follow!
Detailed Explanation of Siemens PLC Structured Programming

Leave a Comment