User`s guide

Getting Star ted with RTDX™
a string that does not identify an existing channel in the executable, the
open operation fails.
In this tutorial, two channels exist on the processor
ichan and ochan.
Although the channels are named
ichan for input channel a nd ochan for
output channel, neither channel is congured for input or output until you
congure them from MATL AB software or CCS IDE. You could congure
ichan as the output channel and ochan as the input channel. The links would
work just the same. For simplici ty , the tutoria l congures
ichan for input
and
ochan for output. O ne more note—reading and writing are dened as
seen by the processor. When you write data from MATL AB software, you
write to the channel that the processor reads,
ichan in this case. Conversely,
when y ou read from the processor, you read from
ochan, the channel that
the processor writes to:
1 Congure buffers in RTDX to store the data until MATLAB software can
read it into your workspace. Often, MATLAB software cannot read data as
quickly as the processor can write it to the channel.
cc.rtdx.configure(1024,4); % define 4 channels of 1024 bytes each
Channel buffers are optional. Adding them provides a measure of insurance
that data gets from your processor to MATLAB software w ithout getting
lost.
2 Dene one of the channels as a write channel. Use ichan for the channel
name and
w for the mode. Either w’or’r ts here, for write or read.
cc.rtdx.open('ichan','w');
3 Now enable the channel you opened.
cc.rtdx.enable('ichan');
4 Repeat step s 2 and 3 to prepare a read channel.
cc.rtdx.open('ochan','r');
cc.rtdx.enable('ochan');
5 To use the new channels, enable R TDX by entering
2-31