■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
▼
Implementing and Handling Applications
DS1103 Hardware Installation and Configuration March 2004
121
▲
■■■■■■■■■■I
▲■■■■■■■■■■■■■■■
How to Implement C Models
To demonstrate how to proceed without MATLAB and Simulink, the
C-coded example
smd_1103_hc.c
is used. This model does not require
any I/O hardware. It simulates a damped spring-mass system
stimulated by a square-wave signal. The parameters are spring, mass
and damper.
To compile and link the application, you can use the
down1103
utility in
a DOS window to call the makefile. After the object file is downloaded
and started, the RTP error check utility is called automatically.
To edit and download an application
1 Open the file
%DSPACE_ROOT%\Demos\DS1103\GettingStarted
\HandCode\smd_1103_hc.c
using a text editor of your choice.
2 Browse through the source code, but do not alter the code yet.
3 To invoke
down1103
, in a DOS window change to the directory
%DSPACE_ROOT%\Demos\DS1103\GettingStarted\HandCode
and type
down1103 smd_1103_hc
The object file
smd_1103_hc.ppc
is generated, downloaded and
started.
4 Use ControlDesk to stop the real-time application:
Select the DS1103 in the Platform Navigator, and click the
Stop RTP/Simulation icon in the Platform toolbar.