User`s guide

Getting Star ted with RTDX™
num_of_msgs should be zero. Using this process to check the amount of
data can m ake your reads more reliable by letting you or your program
know how much data to e xpect.
6 Type the following to verify that your read channel ochan is enabled for
communications.
cc.rtdx.isenabled('ochan')
You should get back ans = 0 you have not enabled the channel yet.
7 Now enable and verify ochan’.
cc.rtdx.enable('ochan');
cc.rtdx.isenabled('ochan')
To show that ochan is ready, MATLAB software responds ans=1.Ifnot,
try enabling
ochan again.
8 Type
pause(5);
The pause function gives the processor extra time to process the data in
indata and transfer the data to the buffer you congured for ochan.
9 Repeat the check for the number of messages in the queue. There should be
20 messages available in the buffer.
num_of_msgs = cc.rtdx.msgcount('ochan')
With num_of_msgs = 20, you could use a looping structure to read the
messages from the queue in to MATL AB software. In the next few steps of
this tutorial you read data from the
ochan queuetodifferentdataformats
within MATLAB software.
10 Read one message from the queue into variable outdata.
outdata = cc.rtdx.readmsg('ochan','int16')
outdata =
2-35