SIMATIC S7-1500 PLC Function Block (FB) and Its Application

Publisher:BlissfulMoonLatest update time:2024-07-18 Source: elecfansKeywords:SIMATIC  S7-1500 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Function Block (FB) and its application

Introduction to Function Block (FB)


Function blocks (FB) are blocks that you program yourself. Function blocks are "memory-equipped" blocks. Data blocks are allocated as their memory (background data blocks). Parameters and static variables transferred to the FB are saved in the instance DB. Temporary variables are saved in the local data stack. When the FB is executed, the data saved in the DB is not lost. However, when the FB is executed, the data saved in the local data stack is lost.


Application of Function Block (FB)

The following example illustrates the application of function blocks.

[Example] Use function blocks to complete star-delta starting control of a motor.

[Answer] The electrical schematic diagram of star-delta starting is shown in Figure 1. Note that the stop button is connected to the normally closed contact.

76a01c6e-2a6c-11ee-a368-dac502259ad0.png

Figure 1

The Star Delta startup project is created as follows.

①Create a new project, this example is "Star-Delta Startup", as shown in Figure 2:

7730b382-2a6c-11ee-a368-dac502259ad0.png

Figure 2

In the project tree of the project view, select and click "Newly added device" (PLC_1 in this example) → "Program Block" → "Add New Block", and the "Add New Block" interface will pop up.

②In the interface "Input", create 4 new variables, as shown in Figure 3:

77a0dea0-2a6c-11ee-a368-dac502259ad0.png

Figure 3

Pay attention to the type of the variable. The comment content can be blank, and the comment content supports Chinese characters. In the interface "Output", create two new variables, as shown in Figure 3. In the interface "InOut", create a new variable, as shown in Figure 3.

In the interface "Static", create two new static variables, as shown in Figure 3. Pay attention to the type of the variable and note that the initial value cannot be 0, otherwise there will be no star-delta startup effect.

③Write the program in the program editing area of ​​FB1, as shown in Figure 4

78335686-2a6c-11ee-a368-dac502259ad0.png

Figure 4

④ In the project tree of the project view, double-click "Main[OB1]" to open the main program block "Main[OB1]", as shown in Figure 5.

78736438-2a6c-11ee-a368-dac502259ad0.png

Figure 5

Drag the function "FB1" to program segment 1, enter the data block DB2 above FB1, and download the entire project to the PLC to realize the "motor star-delta starting control".


Keywords:SIMATIC  S7-1500 Reference address:SIMATIC S7-1500 PLC Function Block (FB) and Its Application

Previous article:2-wire and 3-wire start-stop circuit diagram Two motor control circuit diagram and working principle
Next article:What are the benefits of using PLC to control automatic loading system?

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号