AWPLC is a PLC system independently developed by ZLG (compatible with IEC61131-3). This article uses a simple revolving lantern program to demonstrate how to use AWTK and AWPLC to quickly develop embedded applications.
background
AWTK stands for Toolkit AnyWhere. It is an open source GUI engine developed by ZLG. It is a universal GUI engine designed for embedded systems, WEB, various applets, mobile phones and PCs. It provides users with a powerful, efficient, reliable, easy-to-use GUI engine that can easily create cool effects.
AWPLC is a PLC system independently developed by ZLG (compatible with IEC61131-3). The runtime library (Runtime) of AWPLC is developed based on ZLG TKC and can be ported to any mainstream RTOS and embedded system. The integrated development environment (IDE) of AWPLC is developed based on AWTK and can run on Windows, MacOS and Linux systems. One of the main goals of AWPLC is to introduce the low-code development method of PLC into embedded software, thereby improving the development efficiency and reliability of embedded software.
Introduction
The revolving lantern is easy to implement, and it uses multiple function blocks such as shift and counter. PLC tutorials like to choose it as an example. This article uses a simple revolving lantern program to demonstrate how to quickly develop embedded applications using AWTK and AWPLC.
1. System composition
The system includes:
• A button to trigger the next light to turn on.
• 8 LEDs. Light up in turn to create a revolving lantern effect.
2. Software simulation
• Buttons and LEDs are simulated in software.
PLC Program
-
Variable Definition
In this system, several variables need to be defined:
• PB0 button. Mapped to the first digital input (%IX0.0).
• LEDS 8 LEDs. Mapped to the first 8 digital (ie one byte) outputs (%QB0.0).
The specific configuration is shown in the figure below:
3.2 Function Block Diagram
Basic working principle: Circularly shift the constant 1 to the left. Each time the button is pressed, it shifts 1 bit to the left and writes the result to the LEDS variable. LEDS is an 8-bit unsigned integer (ie, one byte), corresponding to the first 8 digital outputs.
* Note that the data type of constant 1 must be specified as USINT (that is, 8-bit unsigned number) to ensure that the loop is performed according to 8 bits.
The specific implementation is shown in the following figure:
user interface
The application does not require programming. You can design the interface with AWTK Designer and bind the controls to the model. The following is an introduction to the binding method of controls and models. AWTK-MVVM is used here, and the data binding rules are exactly the same as AWTK-MVVM.
The model can use io, plc or io+plc. io can be used to bind IO variables, and plc can be used to bind program PLC internal variables.
Example:
Since the symbol % has a special function in the program, when binding IO variables, replace % with _. For example, write %QX0.0 as _QX0.0.
Example:
Previous article:Rapidly developing embedded applications using AWTK and AWPLC (1) - Temperature controller
Next article:Rapidly develop embedded applications using AWTK and AWPLC (3) - Timer
- Popular Resources
- Popular amplifiers
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- arm_embedded_machine_learning_design_dummies_guide
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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
- Setup and Hold Time
- I was worried for a long time after looking at the program, and it turns out that the IO port multiplexing function in ch579 does not need to be set.
- The difference between using stm32 JTAG and SWD
- Why is it easy to crack the microcontroller?
- TI-84 Plus CE Graphing Calculator to Support CircuitPython
- Introduction to PRoC BLE Bluetooth Low Energy Radio System-on-Chip
- Recruiting part-time simulink training teachers
- Price increase is not a big problem, but chip shortage is the big problem? So, has it had any impact on the engineers in the forum?
- Wi-Fi 7 is here. How powerful is it?
- [HPM-DIY] HPM6750 MicroPython transplantation is successful