function portNumber = slexCustomMappingGetPortNumber(modelName,portName)
%

% Copyright 2012-2017 The MathWorks, Inc. 

%Convert string to char
if isStringScalar( modelName ) 
    
    modelName = char( modelName );
    
end

%Convert string to char
if isStringScalar( portName ) 
    
    portName = char( portName );
    
end

portNumber = [];
if bdIsLoaded(modelName)
    portNumber = get_param([modelName '/' portName],'Port');
end
