| Contents | Index |
Note flush support for C5000 processors will be removed in a future version. |
flush(rx,channel,num,timeout)
flush(rx,channel,num)
flush(rx,channel,[],timeout)
flush(rx,channel)
flush(rx,'all')
This function supports the following IDEs:
Texas Instruments Code Composer Studio v3
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 timeout period stored in rx. flush applies the timeout 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 timeout period stored in rx to determine how long to wait for the process to complete. Compare this to the previous syntax that specifies the timeout 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 timeout period stored in rx. flush applies the timeout 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, your coder product sends all the messages in the write queue to the processor. 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 processor over the input channel, then uses flush to remove a message from the read queue for the output channel:
IDE_Obj = ticcs; rx = IDE_Obj.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');

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |