function generatedFiles = plc_postcg_callback_selectron(fileNames)

%   Copyright 2017-2019 The MathWorks, Inc.

fileName = fileNames{1};
str = fileread(fileName);

str = regexprep(str, 'END_STRUCT','END_STRUCT;');

[globalStart,globalEnd]=regexp(str,'VAR_GLOBAL.*?END_VAR');
if ~isempty(globalStart)
    str = regexprep(str,'VAR_GLOBAL.*END_VAR',...
            ['CONFIGURATION scConfiguration\n'...
            'RESOURCE scResource ON scResourceType\n'...
            str(globalStart(1):globalEnd(end)) '\n'...
            'END_RESOURCE\n'...
            'END_CONFIGURATION\n']);
end
   
sfprivate ('str2file', str, fileName);
generatedFiles = {fileName};

end

% LocalWords:  sc
