Hardware interrupt organization block and its application
Hardware interrupt organization blocks (such as OB40) are used to quickly respond to signal changes of signal modules (SM), communication processors (CP) and function modules (FM).
After the hardware interrupt is triggered by the module, the operating system will automatically identify which slot of the module and which channel in the module generated the hardware interrupt. After the hardware interrupt OB is executed, a channel confirmation signal will be sent.
If an interrupt event is being processed and the same interrupt event occurs in the same module and the same channel, the new interrupt event will be lost.
If an interrupt event occurs in other channels or other modules in the same module while an interrupt signal is being processed, the temporarily stored interrupt will be processed after the currently activated hardware interrupt is executed.
The following example illustrates how to use the hardware interrupt organization block.
[Example] Write a command to record the number of times the user uses the 10.0 button, making it a simple "black box".
[Solution] ① Add organization block OB40. In the project tree of the TIA Portal project view, double-click "Add new block" to pop up the interface shown in Figure 1. Select the "Organization block" and "Hardware interrupt" options, and click the "OK" button to add the OB40 organization block.
Figure 1
② Select the hardware module "DI16×24VDC HF", click the "Properties" tab, as shown in Figure 2, select "Channel 0", enable rising edge detection, and select the hardware interrupt organization block as "Hardware interrupt".
Figure 2
③ Write a program. Write a program in the organization block OB40 as shown in Figure 3. Each time the button is pressed, the program in OB40 is called once, and the value in MW10 is increased by 1, which records the number of times the button is used.
Figure 3
Previous article:What is the Profinet interface communication protocol?
Next article:Diagram of a circuit with two motors running in cycles
Recommended ReadingLatest update time:2024-11-16 13:47
- 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
- Two-color graphic details capacitors and application circuits
- JY02A(居逸電子)馬達驅動IC動作原理
- What is Q
- [Construction Monitoring and Security System] XI. Kaluga MQTT connects to OneNET
- 【RT-Thread Reading Notes】(0) Some basic concepts and understanding of threads
- [GD32E503 Evaluation] Realizing USB disk function based on uCOSIII project 1
- Zero drift phenomenon and its causes
- RISC-V open source hardware board — HiFive Unleashed
- How to choose a replacement battery for the Dyson V6 vacuum cleaner?
- CY8CKIT-149 PSoC 4100S PLUS PROTOTYPING KIT Unboxing and Power-On Run Example