gusucode.com > target工具箱matlab源码程序 > target/foundation/blks/masks/virtualport_callback.m

    function [hSize, vSize] = virtualport_callback (blk, action)

%   VIRTUALPORT_CALLBACK  Sets the properties of the line out and line in
 
%   Copyright 2006-2011 The MathWorks, Inc.
%   $Date:

switch action       
    case 'initFcnOutport'
        % Do this check only before code generation
        % Set frame pointer name based on the port name
        portName = {get_param(blk, 'signalNameStr')};
        portNum  = [1];
        portDataType = {'ImportedExternPointer'};
        [status, errMsg] = setOutPortType('set', blk, portNum, portName, portDataType);
    case 'initFcnInport'
        % Do this check only before code generation
        % Set frame pointer name based on the port name
        portName = {get_param(blk, 'signalNameStr')};
        portNum  = [1];
        portDataType = {'ImportedExternPointer'};
        [status, errMsg] = setInputPortType('set', blk, portNum, portName, portDataType);
    otherwise
        error(message('TARGETFOUNDATION:blocks:UnknownMaskCallback', action));
end