User`s guide

Implementation Overview
9-7
source code of the device drivers for the Keithley Metrabyte DAS 1600/1400
Series I/O boards. See the “Device Driver Blocks” section for information on
howtousetheseblocks.
Simulink Host
The development host must have Windows 95, Windows 98, or Windows NT to
run Simulink. However, the real-time target requires only DOS, since the
executable built from the generated code is not a Windows application. The
real-time target will not run in a “DOS box” (i.e., a DOS window on Windows
95/98/NT).
Although it is possible to reboot the host PC under DOS for real-time execution,
the computer would need to be rebooted under Windows 95/NT for any
subsequent changes to the block diagram in Simulink. Since this process of
repeated rebooting the computer is inconvenient, we recommend a second PC
running only DOS as the real-time target.
Sample Rate Limits
Program timing is controlled by installing an interrupt service routine that
executes the model code. The target PC’s CPU is then interrupted at the
specified rate (this rate is determined from the step size).
The rate at which interrupts occur is controlled by application code supplied
with the Real-Time Workshop. This code uses the PC-AT’s 8254 Counter/Timer
todeterminewhentogenerateinterrupts.
The code that sets up the 8254 Timer is in
drt_time.c, which is in the
matlabroot\rtw\c\dos\rti directory. It is automatically linked in when you
build the program using the DOS real-time template makefile.
The 8254 chip is a 16-bit counter that operates at a frequency of 1.193 MHz.
However, the timing module, drt_time.c in the DOS run-time interface can
extend the range by an additional 16 bits in software, effectively yielding a
32-bit counter. This means that the slowest base sample rate your model can
have is
This corresponds to a maximum base step size of approximately one hour.
1.193
6
×10 2
32
1()÷
1
3600
-------------
Hz