Share this

Real-time simulation and embedded systems

2026-04-06 05:33:32 · · #1
1. Introduction UNIX and Windows are considered excellent operating systems for program development and many interactive applications. However, neither is suitable for real-time applications. Tornado is an embedded development platform provided by Wind River Systems, Inc., and VxWorks is the runtime component of Tornado and the most widely used real-time operating system in the embedded industry. VxWorks performs exceptionally well in real-time, with minimal system overhead. Its system utilities, such as task scheduling, inter-task communication, and interrupt handling, are streamlined and efficient, resulting in minimal latency. VxWorks' multi-tasking mechanism employs priority preemptive scheduling and round-robin scheduling to ensure reliable real-time performance, enabling the same hardware configuration to meet stronger real-time requirements and providing greater flexibility for application development. RTW (Real-Time Workshop) is an important supplementary module to the Matlab graphical modeling and simulation environment Simulink. It is a Simulink-based automatic code generation environment that can directly generate optimized, portable, and customized code from Simulink models and automatically generate programs for various environments based on the target configuration. RTW provides several rapid prototyping targets, including Tornado Real-Time Target, which provides an automatic conversion interface from Simulink models to VxWorks application code, allowing users' models to run on VxWorks. 2. Tornado (VxWorks) Real-Time Target Runtime Structure A typical configuration for developing a VxWorks real-time application system is shown in Figure 1: The real-time code is compiled on the host using the cross-compiler provided by Tornado. The target file (vxmodel.lo) is generated by the Tornado real-time target of RTW and can be downloaded to the VxWorks target machine through WindSh in the Tornado integrated development environment. The real-time program is executed on the VxWorks target machine, exchanges data with external hardware through IO devices, and maintains mutual communication with the host. The real-time program runs on the VxWorks target machine, while Simulink runs on the host. Simulink needs tasks running on the VxWorks target machine to handle the communication process. The Tornado (VxWorks) Real-Time Target generates the following VxWorks tasks: one for communicating with Simulink, and others for completing model functions [2]. 3. Implementation process of Tornado (VxWorks) real-time target 3.1 Experimental environment My experimental environment is as follows: Table 1 Experimental environment 3.2 Specific implementation steps of real-time target In order to implement and run a real-time program based on VxWorks through Real-Time Workshop, the user can follow the steps below: (1) Create a model in Matlab/Simulink. Here, a classic PID model is used as an example: The model adopts the external working mode and sets the parameters in the Simulink Parameters dialog box: (2) Configure the template binding file tornado.tmf. This file is located in the matlabroot%/rtw/c/tornado directory. The following modifications need to be made to this file: #———————————— Macros read by make_rtw ————————————- MAKECMD = C:Tornado2.2hostx86-win32 inmake HOST = PC #————————————-Tool Locations————————————————————————————- WIND_BASE= C:Tornado2.2 WIND_REGISTRY=$(COMPUTERNAME) WIND_HOST_TYPE=x86-win32 #————————————Vxworks Configuration—————————————————— VX_TARGET_TYPE = pentium CPU_TYPE = PENTIUM2 #————————————-Macros for Downloading to Target————- TARGET=target TGTSVR_HOST=host VX_CORE_LOC = $(WIND_BASE)/target/config/pcPentium3/vxWorks (3) After setting the parameters for program generation, compilation, and linking, save the settings and start creating the program. Click the Build button in the above figure to start compiling the program. After successful compilation, a folder named vxmodel_tornado_rtw and a target file vxmodel.lo will be generated in the current directory. (4) Manually downloading and running the executable file. The real-time program can now be downloaded to the target machine. Specifically, launch WindSh in the Tornado integrated development environment and execute the following command in the WindSh window: ld 4. Conclusion This paper introduces the runtime structure of RTW for Tornado (VxWorks) real-time targets, taking into account the simulation characteristics of Matlab and the real-time features of the VxWorks operating system. It also elaborates on the specific implementation process of Tornado (VxWorks) real-time targets and achieves Simulink simulation under Tornado (VxWorks) real-time targets. In addition to relevant documentation, the author has incorporated personal experimental experience, supplemented necessary content, and improved the specific experimental steps, reducing the debugging difficulty for readers in future experiments. Editor: He Shiping
Read next

CATDOLL Himari Hybrid Silicone Head

The hybrid silicone head is crafted using a soft silicone base combined with a reinforced scalp section, allowing durab...

Articles 2026-02-22