function portNames = slexCustomMappingGetPortNames(modelName,blockType)
%

% Copyright 2012-2017 The MathWorks, Inc. 


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

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


portNames = get_param(find_system(modelName,...
    'SearchDepth',1,'BlockType',blockType),'Name');
%if the portNames is a character array it means we have only 1
%port of this block type. Convert to a cell array.
if ischar(portNames)
    %turn inports into a cellarray for output consistency.
    portNames{1} = portNames;
end
