Real-Time Workshop | ![]() ![]() |
Device Driver Requirements and Limitations
In order to create a device driver block, the following components are required:
mex
utility builds this component (a DLL under Windows, or a shared library under UNIX).
We recommend that you use the S-function template provided by Real-Time Workshop as a starting point for developing your driver S-functions. The template file is
An extensively commented version of the S-function template is also available. See matlabroot
/simulink/src/sfuntmpl_doc.c
.
The following components are optional:
Limitations of Device Driver Blocks
The following limitations apply to noninlined driver blocks:
The following applies to inlined driver blocks:
mdlRTW
function, parameter restrictions are the same as for noninlined drivers.
mdlRTW
function, any parameter type is supported.
Preemption
Consider preemption issues in the design of your drivers. In a typical real-time program, a timer interrupt invokes rtOneStep
, which in turn calls MdlOutputs
, which in turn calls your input (ADC) and /or output (DAC) drivers. In this situation, your drivers are interruptible.
![]() | Inlined and Noninlined Drivers | Parameterizing Your Driver | ![]() |