refresh.m

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

M
30 行
字号
function dummy = refresh(r)
%REFRESH  Reopens all RTDX channels that are severed during a program load
%   REFRESH(R) - After loading a new program file in Code Compser
%   Studio(tm), all RTDX handles become 'stale'.  Even if the new 
%   program file contains equivalently named and configured channels, 
%   it is necessary to reopen the channels.   This method restablishes
%   previously opened RTDX channels defined in R.
%
%   See also CLOSE, OPEN.

% Copyright 2002 The MathWorks, Inc.
% $Revision: 1.2 $ $Date: 2002/03/22 21:43:21 $

chan = get(r,'RtdxChannel');
close(r,'all');

for ic = 1:r.numChannels,
    name = chans{ic,1};
    enstat = chans{ic,2};
    ctype = chans{ic,3};
    try
        open(r,name,ctype);
    catch
        disp(lasterr);
        warning(['Failed to open channel: ''' name '''']);
    end
end

% [EOF] refresh.m

⌨️ 快捷键说明

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