Rapid Prototyping and Automatic Code Generation for Real-time
Systems
Modern control system design software allows real-time code (typically C
or Ada) to be generated automatically from e.g. a SIMULINK/StateFlow block
diagram, which is essentially a high-level graphical description of the control
system. Simulation, prototyping, hardware-in-the-loop simulation and production
code can be developed within the same software environment. Advantages of
this approach includes
short development time
no programming required
debugging though simulation
the automatically generated code has a uniform style and documentation
for each block, the automatically generated code is generated accoding
to a template that can be defined by the user
simple reuse of code through block libraries
open interface that allows the code to be embedded in most systems, as
well as custom code and custom IO-driver blocks to be wrapped as blocks
a large amount of IO devices are supported in terms of IO-driver blocks
several microcontrollers, DSPs, CPUs etc. are currently being interfaced
and supported
Some available software solutions
Block diagram graphical language:
SIMULINK and StateFlow
(MathWorks Inc. and Comsol
AS)
Basic tools for automatic code generation (including DOS, VxWorks and other
platforms): Real-time Workshop,
MathWorks Inc.
Integrated HW/SW environment for rapid prototyping:
dSPACE
Fixed-point code generation:
dSPACE TargetLink
WindowsNT/RTX and RT-Linux real-time systems: WinCon,
Quanser Consulting
Intel/QNX real-time systems: Opal-RT
PC-based real-time systems:
xPC target
At the Department of Engineering Cybernetics we have used various systems
for undergraduate students laboratories (RTW/WinCon/RTX), research laboratories
(RTW,dSPACE,Opal/QNX,Intel,PC/104,xPC) (
example) and industry projects (RTW,dSPACE,Opal/QNX).
Tor Arne Johansen,
NTNU