Skip to Main Content Skip to Search
Product Documentation

msgcount - Number of messages in read-enabled channel queue

Syntax

msgcount(rx,'channel')

IDEs

This function supports the following IDEs:

Description

msgcount(rx,'channel') returns the number of unread messages in the read-enabled queue specified by channel for the RTDX interface rx. You cannot use msgcount on channels configured for write access.

Examples

If you have created and loaded a program to the processor, you can write data to the processor, then use msgcount to determine the number of messages in the read queue.

  1. Create and load a program to the processor.

  2. Write data to the processor from MATLAB software.

    indata=1:100;
    writemsg(IDE_Obj.rtdx,'ichannel', int32(indata));
    
  3. Use msgcount to determine the number of messages available in the queue.

    num_of_msgs = msgcount(IDE_Obj.rtdx,'ichannel')
    

See Also

read | readmat | readmsg

  


Related Products & Applications

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