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.
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:
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:
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
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.
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".
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?
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What is the difference between TI's DSP2812 and 28335?
- Ended -- Microchip Live Broadcast [Implementing MultiZone Security in RISC-V Applications]
- CPLD driving small lamp simulation problem
- Loto Practice Tips (5) Detecting the power-on reset failure of the microcontroller with an oscilloscope
- Detailed explanation of EMC radiated emission test and conducted emission test
- 1
- RC Filtering
- 6ULL-BM140P Base Plate Manual
- Research and experience on vehicle control strategy for CAN bus application in pure electric vehicles
- After CC2541 is in master mode and searches for slaves to connect, the host can receive the data sent by the slave, but the slave cannot receive the data sent by the master?