Speaking of library instructions, I believe everyone is familiar with the three words "library instructions"! Library instructions are often used whether you are learning PLC or using PLC programming, but sometimes you need to create library instructions yourself. Why do you need to create library instructions yourself? When we are programming, we often need to call a certain program repeatedly, and it is very troublesome to write it every time. At this time, we need to make this program into a library instruction so that we can call it repeatedly. Well, without further ado, let's analyze it in detail.
01 Programming Procedure
Step 1: (Open STEP7-MicroWIN SMART programming software on the desktop)
Step 2: (Create variables in the subroutine (SBR))
Here is an example of creating a library file for the start-stop program
Create variables in the variable table
Symbol: Start Variable type: IN Data type: BOOL
Symbol: Stop Variable type: IN Data type: BOOL
Symbol: Run Variable type: OUT Data type: BOOL
Automatically create an address after selecting the data type
Step 3: (Write the start-stop program in the subroutine and fill it in with the variables created in step 2)
Step 4: (Change the subroutine name, select SBR-0 with the mouse, right-click Properties - General - Modify the name, here change it to Start Protection Stop Warehouse Instruction)
Warm reminder: If you do not change the subroutine name when creating a library instruction, an error will be reported and prompted (placing this instruction requires creating one or more POUs).
Step 5: (Select the library in the project tree on the left side of the programming software and right-click to select Create Library. After opening, enter the library name, click the Next Component, select the Start-Protection-Stop Library Instruction, and click Add. You will see that the Start-Protection-Stop Library Instruction has been successfully added on the right. At this time, keep clicking Next until the Create step and click Create. Look at the output window and the library file is created successfully.)
02 Call library instructions
Step 1: (After restarting the STEP7-MicroWIN SMART programming software, you will see the library instruction name created previously in the project tree library instruction on the left)
Step 2: (Call the start-protection and stop-warehouse instruction in the main program and fill in the corresponding pins)
03 Monitor test library instructions
Step 1: (Download the program)
Step 2: (Monitor PLC and force I0.0, Q0.0 output from 0 to 1)
Previous article:How to quickly solve problems with the PLC body
Next article:Introduction to the communication methods of mainstream PLC equipment abroad
Recommended ReadingLatest update time:2024-11-16 10:25
- 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.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- 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