User`s guide

flush
flush(rx,channel) removesallpendingdatamessagesfromthe
RTDX channel queue specied by
channel in rx.Unlikethepreceding
syntax o ptions, you use this statem ent to r e mov e messages for both
read-congured a nd write-congured channels.
flush(rx,'all') removes all data messages from all RT DX channel
queues.
When you use
flush with a write-congured RTDX channel, Embedded
IDE Link CC sends all the messages in the write q ueue to the p rocessor.
For read-congured channels,
flush removes one or more messages
from the queue depending on the input argument
num you supply and
disposes of them.
Examples To demonstrate flush, this example writes data to the proc essor ove r
the input channel, then uses
flush to remove a m essage from the read
queue for the output channel:
cc = ticcs;
rx = cc.rtdx;
open(rx,'ichan','w');
enable(rx,'ichan');
open(rx,'ochan','r');
enable(rx,'ochan');
indata = 1:10;
writemsg(rx,'ichan',int16(indata));
flush(rx,'ochan',1);
Now ush the remaining messages from the read channel:
flush(rx,'ochan','all');
See Also enable, open
7-54