| Embedded IDE Link™ CC | ![]() |
flush(rx,channel,num,timeout)
flush(rx,channel,num)
flush(rx,channel,[],timeout)
flush(rx,channel)
flush(rx,'all')
flush(rx,channel,num,timeout) removes num oldest data messages from the RTDX channel queue specified by channel in rx. To determine how long to wait for the function to complete, flush uses timeout (in seconds) rather than the global time-out period stored in rx. flush applies the time-out processing when it flushes the last message in the channel queue, because the flush function performs a read to advance the read pointer past the last message. Use this calling syntax only when you specify a channel configured for read access.
flush(rx,channel,num) removes the num oldest messages from the RTDX channel queue in rx specified by the string channel. flush uses the global time-out period stored in rx to determine how long to wait for the process to complete. Compare this to the previous syntax that specifies the time-out period. Use this calling syntax only when you specify a channel configured for read access.
flush(rx,channel,[],timeout) removes all data messages from the RTDX channel queue specified by channel in rx. To determine how long to wait for the function to complete, flush uses timeout (in seconds) rather than the global time-out period stored in rx. flush applies the time-out processing when it flushes the last message in the channel queue, because flush performs a read to advance the read pointer past the last message. Use this calling syntax only when you specify a channel configured for read access.
flush(rx,channel) removes all pending data messages from the RTDX channel queue specified by channel in rx. Unlike the preceding syntax options, you use this statement to remove messages for both read-configured and write-configured channels.
flush(rx,'all') removes all data messages from all RTDX channel queues.
When you use flush with a write-configured RTDX channel, Embedded IDE Link™ CC sends all the messages in the write queue to the target. For read-configured channels, flush removes one or more messages from the queue depending on the input argument num you supply and disposes of them.
To demonstrate flush, this example writes data to the target over the input channel, then uses flush to remove a message 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 flush the remaining messages from the read channel:
flush(rx,'ochan','all');
![]() | execute | get | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |