User`s guide

2 Automa tion Interface
12 17
13 18
Because a 5-by-2 matrix requires ten elements, MATLAB software reads
one message into
outdata to ll th e matrix.
17 To check your progress, see how many messages remain in the queue. You
have read eight messages from the queue so 12 should remain.
num_of_msgs = cc.rtdx.msgcount('ochan')
num_of_msgs =
12
18 To demonstrate the connection between messages and a matrix in MATLAB
software, read data from
'ochan' to lla4-by-5matrixinyourworkspace.
outdata = cc.rtdx.readmat('ochan','int16',[4 5])
outdata =
10 14 18 13 17
11 15 19 14 18
12 16 11 15 19
13 17 12 16 20
Filling the matrix required two messages w orth of data.
19 To ve rify that the last step used two messages, recheck the message count.
You should nd 10 messages waiting in the queue.
num_of_msgs = cc.rtdx.msgcount('ochan')
20 Continuing with matrix reads, ll a 10-by-5 matrix (50 matrix elements or
ve messages).
outdata = cc.rtdx.readmat('ochan','int16',[10 5])
outdata =
12 13 14 15 16
13 14 15 16 17
14 15 16 17 18
2-38