Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

DEF=lance_RIF_imp(DEFi,NUM)
function DEF=lance_RIF_imp(DEFi,NUM)

  DEF=DEFi;
  try
    n=get_param(gcs,'name');
catch
    n='filtre_FIR';
end;
if ~strcmp(n,'filtre_FIR_imp')
    stop_simulation_tournant_eventuellement;
end;
repertoire=pwd;
cd ..
A=load('parametres_carte.mat');
cd(repertoire)
carte_sortie=A.S.sortie.carte;
plage_sortie=num2str(A.S.sortie.pop);
if ~isempty(NUM)
            te=DEFi(1);
            modele='filtre_FIR_imp';
            open_system([modele,'.mdl'])
             bloc3=[modele,'/compil'];
             set_param(bloc3,'foregroundcolor','white')
            set_param(gcs,'solver','FixedStepDiscrete')
            set_param(gcs,'StartTime','0') 
            set_param(gcs,'StopTime','Inf') 
            set_param(gcs,'SystemTargetFile','rtwin.tlc') 
            s=get_param(gcs,'Name');
             sbao=[s,'/Analog Output'];
            set_param(sbao,'drvname',carte_sortie);
            set_param(sbao,'voltrange',plage_sortie);
             sbao1=[s,'/Analog Output1'];
            set_param(sbao1,'drvname',carte_sortie);
            set_param(sbao1,'voltrange',plage_sortie);
            set_param(gcs,'SimulationMode','external');
            set_param(gcs,'ExtMode','on');
            duration=100000;
            set_param(gcs,'ExtModeTrigDuration',duration);
            bloc_filtre=[modele,'/Discrete FIR Filter'];
              try
                set_param(bloc_filtre,'numcoeffs',['[',num2str(NUM,'%16.7e'),']']);
            catch
                set_param(gcs,'simulationcommand','stop');
                pause(1)
                set_param(bloc_filtre,'numcoeffs',['[',num2str(NUM,'%16.7e'),']']);
            end;
       
            if faut_il_recompiler
                 set_param(bloc3,'foregroundcolor','red')
                 pause(1)
                rtwbuild(gcs);
                pause(1)
                 set_param(bloc3,'foregroundcolor','white')
            end;
            set_param(gcs,'SimulationCommand','connect');          
            set_param(gcs,'SimulationCommand','start')
            [tim,dum,dum,drv,slice,perf,dum,dum,mach]=rttool('read',0,'timers');
            [per,dum,dum,run]=rttool('read',tim,'period');
            DEF(1)=per;
             bloc=[modele,'/Subsystem'];
            set_param(bloc,'maskvaluestring',num2str(DEF(1)))
end;
    

Contact us