msgcount.m

来自「这是一个关于MATLAB的函数」· M 代码 · 共 28 行

M
28 行
字号
function num = msgcount(r, channelName)
%MSGCOUNT Get number of messages in specified 'read' configured channel queue.
%   MSGCOUNT(R, CHANNEL) returns an integer value denoting the number of data
%   messages in the 'read' configured RDTX(tm) channel queue specified by the 
%   string CHANNEL, and as defined in the RTDX object R.  This method does not 
%   work for channels configured for 'write' operation.

% Copyright 2001-2002 The MathWorks, Inc.
% $Revision: 1.13 $ $Date: 2002/06/12 15:30:17 $

if ~ischar(channelName),
	error('Channel name must be a character string.');
    return
elseif isempty(channelName),
	error('Channel name cannot be an empty string.');
    return
end

% Look for specified channel name
chID = strmatch(channelName, {r.RtdxChannel{:,1}}, 'exact');
if isempty(chID),
    error('Specified channel is not open.');
end

num =  ccsmexswitchyard([110,r.boardnum,r.procnum,0,0],channelName);

% [EOF] msgcount.m

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?