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

[MOG,DEF]=lance_RII(MOGi,DEFi,NUM,DEN)
function [MOG,DEF]=lance_RII(MOGi,DEFi,NUM,DEN)


DEF=DEFi;
MOG=MOGi;
  try
    n=get_param(gcs,'name');
catch
    n='filtre_IIR';
end;
if ~strcmp(n,'filtre_IIR')
    stop_simulation_tournant_eventuellement;
end;
repertoire=pwd;
cd ..
A=load('parametres_carte.mat');
cd(repertoire)
carte_entree=A.S.entree.carte;
carte_sortie=A.S.sortie.carte;
plage_entree=num2str(A.S.entree.pop);
plage_sortie=num2str(A.S.sortie.pop);
if ~isempty(NUM)&&~isempty(DEN)
            nettoyage;
            te=DEFi(1);
            modele='filtre_IIR';
            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');
            sbai=[s,'/Analog Input'];
             set_param(sbai,'drvname',carte_entree);
            set_param(sbai,'voltrange',plage_entree);
             sbao=[s,'/Analog Output'];
            set_param(sbao,'drvname',carte_sortie);
            set_param(sbao,'voltrange',plage_sortie);
            set_param(gcs,'SimulationMode','external');
            set_param(gcs,'ExtMode','on');
            duration=100000;
            bloc_filtre=[modele,'/Discrete Filter'];
             try
                set_param(bloc_filtre,'numerator',['[',num2str(NUM,'%16.7e'),']']);
                set_param(bloc_filtre,'denominator',['[',num2str(DEN,'%16.7e'),']']);
             catch
                 set_param(gcs,'simulationcommand','stop');
                pause(1)
                set_param(bloc_filtre,'numerator',['[',num2str(NUM,'%16.7e'),']']);
                set_param(bloc_filtre,'denominator',['[',num2str(DEN,'%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