User`s guide
2 Automa tion Interface
234567891011
Notice the ’int16’ represent o ption. When you read data from your
processor you need to tell MATL AB software the data type you are reading.
You wrote the data in step 4 as 16-bit integers so you use the same data
type here.
While performing reads and writes, your process continues to run. You
did not need to stop the processor to get the data or send the data, unlike
using most debuggers and b reakpoints in your code. You placed your data
in memory across an RTDX channel, the processor used the data, and you
read the d ata from memory across an RTDX channel, without stopping
the processor.
11 You can read data into cell arrays, rather than into simple double-precision
variables. Use the following function to read three messages to cell array
outdata, an array of three, 1-by-10 vectors. Each message is a 1-by-10
vector stored on the processor.
outdata = cc.rtdx.readmsg('ochan','int16',3)
outdata =
[1x10 int16] [1x10 int16] [1x10 int16]
12 Cell array outdata contains thre e mess ages. Look at the second message,
or matrix, in
outdata by using dereferencing with the a rray.
outdata{1,2}
outdata =
45678910111213
13 Read two messages from the processor into two 2-by-5 matrices in your
MATLAB workspace.
outdata = cc.rtdx.readmsg('ochan','int16',[2 5],2)
outdata =
[2x5 int16] [2x5 int16]
2-36