[Example] There is a control system, the controller is CPU 1511C-IPN, the pressure sensor measures the oil pressure, the oil pressure range is 0 ~ 10MPa, when the oil pressure is higher than 8MPa, an alarm will be triggered. Please design this system.
[Answer] CPU 1511C-1PN integrates analog input/output and digital input/output. Its wiring is shown in Figure 1. Terminals 1 and 2 of the analog input are respectively connected to the current signal + and current signal - of the sensor.
Figure 1
Numeric Conversion (FC105) The SCALE function accepts an integer value (IN) and converts it to a real value between the lower and upper limits (LO_LIM and HI_LIM) of the engineering units table.
① Create a new project. Create a new project "Alarm". In the project tree of the TIA Portal software project view, click "Add New Block" to create a new program block. The block name is "Pressure Acquisition". Select the programming language as "LAD" and the block type as "Function FC". Then click the "OK" button, as shown in Figure 2, to generate function FC1, whose programming language is LAD.
Figure 2
② Define the variables of the function. Open the newly created function "FC1" and define the input variable (Input), output variable (Output) and temporary variable (Temp) of function FC1, as shown in Figure 3. Note: These variables are local variables and are only valid within this function.
Figure 3
③Insert the SCALE instruction. Click "Instructions" → "Basic Instructions" → "Original" → "SCALE" to insert the SCALE instruction.
④ Write the LAD program of function FC1 as shown in Figure 4.
Figure 4
⑤ Add loop organization block OB30 and write LAD program, as shown in Figure 5. The pin of FC1 is very similar to CALE in the instruction, and the pressure variable range collected is within 0~10MPa.
Figure 5
Previous article:What are the main reasons for the axial movement of the motor rotor?
Next article:Application of Xinsen AN3V PB50 programmable Hall current sensor in permanent magnet synchronous servo motor
Recommended ReadingLatest update time:2024-11-16 09:37
- 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
- (Bonus 5) GD32L233 Review - CRC (with the clearest article explaining CRC in history)
- Recruiting MCU development engineers (workplace: Beijing, Wuhan)
- ST FOC electrical angle problem
- Altium Designer software is abnormal, please solve it! ! !
- Car-to-everything design
- Unboxing
- Programming Techniques in FPGA Design
- TMS320F28335 and its minimum system design
- 2022 Digi-Key Innovation Design Competition + ESP32-S2-KALUGA1 Unboxing
- Defensive C Programming in Embedded Development