User`s guide

10 Interrupts Versus Polling
10-12
I/O Drivers Using Kernel Timing Information Cannot Be Used Within a
Model
Some xPC Target drivers use timing information exported from the kernel in
order to run properly, for example, for the detection of time-outs. Because the
standard timing engine of the real-time kernel is not running during the entire
target application execution in polling mode, timing information passed back
to the drivers is incorrect. Therefore, you cannot use drivers importing the
header file
time_xpcimport.h. This is a current restriction only. In a future
version of polling mode, all drivers will make use of the Pentium counter for
getting timing information instead.
Controlling the Target Application
As mentioned, there is no way to interact with the running target application
in polling mode. This is especially restrictive for the case of stopping the model
execution before the application has reached the stop time that was defined
before the execution started. Because polling mode tries to be as optimal as
possible, any rapid-prototyping feature except signal logging is disabled. But
because I/O driver blocks added to the model are fully functional, you can use
I/O drivers to get to a minimal level of interactivity.
Stopping a target application using polling mode — You can use a
low-latency digital input driver for the digital PCI board in your model, which
reads in a single digital TTL signal. The signal is TTL low unless the model
execution should be stopped, for which the signal changes to TTL high. You can
connect the output port of the digital input driver block to the input port of a
Stop simulation block, found in the standard Simulink block library. This stops
the execution of the target application, depending on the state of the digital
input signal. You can either use a hardware switch connected to the
board-specific input pin or you can generate the signal by other means. For
example, you could use another digital I/O board in the host machine and
connect the two boards (one in the host, the other in the target) over a couple
of wires. You could then use MathWorks Data Acquisition Toolbox to drive the
corresponding TTL output pin of the host board to stop the target application
execution from within MATLAB.