Overview of xPC―target Rapid Prototyping Technology
XPC-target is a real-time kernel system, which is a product provided and distributed by Mathworks based on RTW framework system. Firstly, this paper introduces the rapid prototyping technology of xPC-target, and analyzes the structure of xPC-target rapid prototyping system in detail. Finally, the interface part of xPC-target API is described. The results show that xPC-target rapid prototyping technology has strong practicability.
XPC- target; Rapid prototyping technology; XPC- target APIRTW framework system
XPC-target is the kernel of a real-time system, and it is a RTW-based system and distribution product provided by Mathworks. In this paper, the rapid prototyping technology of xPC-target is introduced firstly, and the structure of xPC-target rapid prototyping system is carefully analyzed. Finally, the interface part of xPC-target API is described. The results show that xPC-target rapid prototyping technology has strong practicability.
Keywords xpc-target;; Rapid prototyping technology; XPC- target API global travel framework
Introduction to 0
XPC-target is a real-time kernel system, which is a product provided and distributed by Mathworks based on RTW framework system. The system runs on the target computer in 32-bit protection mode for product prototype development and testing. It supports various types of I/O devices, and users can use PC compatible computers as xPC target real-time systems only by installing relevant software and compilers. On this basis, we can understand that xPC-target has its unique advantages in real-time simulation.
Introduction of rapid prototyping technology of 1 xPC target
As a toolbox of matlab/simulink, xPC-target is a solution for real-time system design, testing and parameter adjustment based on standard PC hardware. XPC target adopts dual-machine mode, that is, the host computer (upper computer) controls the target computer (lower computer). The target computer can exchange information with the outside world by expanding various I/O cards to form a closed-loop control system, thus realizing the research and development test function.
XPC-target is powerful and easy to operate, and users can easily realize rapid prototyping, testing and configuration of real-time systems. The PC with common configuration can be embedded into the xPC real-time system as the target machine, and the application generated by compiling Simulink and RTW can run in this system in real time.
It has a rich library of I/O device driver modules and supports various CAN buses.
The communication between the host computer and the target computer is realized through RS232 serial port or TCP/IP protocol of Ethernet.
MATLAB application program interface adopts client/service mode, which provides more than 90 functions for the host computer to control the target computer.
When the program is running, the parameters can be dynamically adjusted from the host or the target computer.
Interactive data visualization and signal tracking can be performed on the host computer and the target computer.
Support the development tools above Microsoft Visual C/C++ 5.0.
XPC target adopts dual-machine mode, and there are many options for upper computer and lower computer.
Composition of 2 xPC-target rapid prototyping system
Upper computer: it can be an ordinary notebook or desktop, running matlab/simulink, establishing a simulation model, using RTW(Real Time Workshop) in matlab environment, automatically converting the simulink model into an efficient executable C code through the compiler associated with xPC toolbox, and downloading the program from the upper computer to the target computer for real-time operation through RS232 or TCP/IP communication protocol. If TCP/IP communication protocol is used, one host can control multiple target machines through a switch.
When the simulink model is set to external mode, the parameters of the simulink module or variable can be directly adjusted online in the upper computer to realize online parameter adjustment. By setting the host range, the waveform of variables in the target machine can be observed at will in the upper computer.
Target machine: it can be a desktop or industrial computer with PCI slot. The startup disk (U disk or CD) generated by the upper computer is started, and the real-time system in the startup disk runs the C code downloaded by the upper computer. In the closed-loop control system of fan converter in this paper, because it involves power electronic components, it is necessary to reduce the operation steps as much as possible in order to adopt the operation mode of the target machine. Poll? Mode, rather than interrupt mode, can minimize the running step size without overflowing the operation time. Considering the multi-function data acquisition card, network communication module (not communicating with the upper computer here) and the running time of the model, the maximum running step can be controlled below 50 microseconds.
Introduction of 3 xPC-target API interface
XPC- The API programming interface of the target allows the user to customize the U/I interface. The corresponding program can be called by other software to realize the customized monitoring panel.
API is the abbreviation of application program interface, and it is the calling interface left by the operating system for applications. API is some predefined functions, the purpose of which is to provide applications and developers with the ability to access a set of routines based on certain software or hardware, without accessing the source code or knowing the details of the internal working mechanism. API is a specification, which specifies the data exchange mode between two softwares. XPC- Target provides multiple APIs, and these interfaces provide the same function to customize the solution. Users can create custom applications to control real-time applications to run on the target. XPC-target provides a series of API functions for users to create their own graphic interface of upper computer, which is used to handle the communication between upper and lower computers, manage the program of the target computer, monitor signals and adjust parameters. Through these functions, users can create an interface to control the real-time program of the target computer. XPC-target has two powerful application program interfaces, namely, xPC-target API and xPC-target COM API. Through these two interface modes, users can completely control and observe signals and complete the related functions of interface operation.
1)xPC- target API
With xPC-target API, users can realize the following functions:
1 Establish communication between the host and the target machine through Ethernet or serial port;
2. Load the target application dlm file to the target computer;
3. Run the loaded application on the target machine;
4. Monitor the running state of the target application on the target machine;
5. Control the start and stop of the application program on the target machine;
6. Uninstall the application from the target computer;
7 Close the connection between the host and the target machine.
2)xPC- target COM API
Xpc target COM API is an open interface of application development environment, which is used to coordinate between Microsoft COM standard and XPC target. The XPC target COM API provides a functional group with the same functions as the xpc target. XPC- target API is a dynamic link library of C functions, and xPC- target COM API is a collection of objects, classes and functions organized together. This collection can be manipulated through some graphical development interfaces. Using these graphical development environments, user interface programs that can interact with xPC target applications can be established.
4 conclusion
The structure of xPC-target rapid prototyping system and the interface of xPC-target API are introduced. The description of xPC-target hardware and software shows the practicability of xPC-target technology.
Click the next page for details >>& gt Rapid Prototyping Manufacturing Technology Paper