function genBusDataLegacy()
rootPath = evalin('base', 'rootPath');
clc
clear mex
currdir_ = pwd;
cd(rootPath);
cd('.\mex');

disp('Generate Legacy code for outBus_Legacy');
   def = legacy_code('initialize');
   def.SFunctionName = 'outBus_Legacy_SfL';
   def.InitializeConditionsFcnSpec = '';
   def.OutputFcnSpec = 'void outBus_Legacy(uint32 u1, Data_Output_Test_OrthOsc2 y1[1])';
   def.TerminateFcnSpec = '';
   def.HeaderFiles = {'getBusData_Legacy.h'};
   def.SourceFiles = {''};
   def.IncPaths = {'../simulink/test/+TestOrthOscObjO/+genSfnLegacy', '../Simulink/test/+TestOrthOscObjO/+genSfn' ...
       , '../CRJ/incApplSpecific/stdef_SmlkSfunc', '../CRJ/incComplSpecific/cc_SmlkSfunc', '../CRJ/source', '../CRJ/source/OSAL'};
   def.SrcPaths = {'.'};
   %def.SampleTime = [1];
   legacy_code('sfcn_cmex_generate', def);
   legacy_code('compile', def,'-g');
   %legacy_code('generate_for_sim', def, 'ccs_1p_OB_dc_offset_sfunc_block');
    legacy_code('slblock_generate', def, 'testAcclLegacy');
    legacy_code('sfcn_tlc_generate', def);
    legacy_code('rtwmakecfg_generate', def);
   %%%-MATLAB_Construction_Commands_End
   
disp('Generate Legacy code for BusDataLegacy');
   def = legacy_code('initialize');
   def.SFunctionName = 'getBusData_Legacy_SfL';
   def.InitializeConditionsFcnSpec = '';
   def.OutputFcnSpec = 'void getBusData_Legacy(Data_Output_Test_OrthOsc2 u1[1], single y1[1], single y2[1])';
   def.TerminateFcnSpec = '';
   def.HeaderFiles = {'getBusData_Legacy.h'};
   def.SourceFiles = {''};
   def.IncPaths = {'../simulink/test/+TestOrthOscObjO/+genSfnLegacy', '../Simulink/test/+TestOrthOscObjO/+genSfn' ...
       , '../CRJ/incApplSpecific/stdef_SmlkSfunc', '../CRJ/incComplSpecific/cc_SmlkSfunc', '../CRJ/source', '../CRJ/source/OSAL'};
   def.SrcPaths = {'.'};
   %def.SampleTime = [1];
   legacy_code('sfcn_cmex_generate', def);
   legacy_code('compile', def,'-g');
   %legacy_code('generate_for_sim', def, 'ccs_1p_OB_dc_offset_sfunc_block');
    legacy_code('slblock_generate', def, 'testAcclLegacy');
    legacy_code('sfcn_tlc_generate', def);
    legacy_code('rtwmakecfg_generate', def);
   %%%-MATLAB_Construction_Commands_End
   
cd(currdir_);
end   
   