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

lance_correcteur_num.m
N=DEF(3);
nom=get_param(gcs,'name');
schema_modele='boucle_fermee_num';
test=strcmp(nom,schema_modele);
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 ~test
    schema_modele='boucle_fermee_num';
    open_system([schema_modele,'.mdl'])
    set_param(gcs,'location',ecran)
    set_param(gcs,'zoomfactor','fitsystem')
    bloc3=[schema_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);
    sbai1=[s,'/Analog Input1'];
    set_param(sbai1,'drvname',carte_entree);
    set_param(sbai1,'voltrange',plage_entree);
    sbai2=[s,'/Analog Input2'];
    set_param(sbai2,'drvname',carte_entree);
    set_param(sbai2,'voltrange',plage_entree);
    sbai3=[s,'/Analog Input3'];
    set_param(sbai3,'drvname',carte_entree);
    set_param(sbai3,'voltrange',plage_entree);
    sbao=[s,'/Analog Output'];
    set_param(sbao,'drvname',carte_sortie);
    set_param(sbao,'voltrange',plage_sortie);
    bloc_sat=[schema_modele,'/Correcteur/Correc_Num/Saturation'];
    set_param(bloc_sat,'upperlimit',num2str(A.S.sortie.val_max));
    set_param(bloc_sat,'lowerlimit',num2str(A.S.sortie.val_min));
    set_param(gcs,'SimulationMode','external');
    set_param(gcs,'ExtMode','on');
    duration=100000;
    set_param(gcs,'ExtModeTrigDuration',duration);
end;
schema_modelecor=[schema_modele,'/Correcteur'];
bloc_correcteur=[schema_modelecor,'/Correc_Num'];
% Faut-il recompiler ?
% changement ordre du filtre
try
    set_param(bloc_correcteur,'nc',NC)
    set_param(bloc_correcteur,'dc',DC)
catch
    set_param(gcs,'simulationcommand','stop')
    pause(1)
     set_param(bloc_correcteur,'nc',NC)
    set_param(bloc_correcteur,'dc',DC)
end;

 bloc3=[schema_modele,'/compil'];
 if faut_il_recompiler
           set_param(bloc3,'foregroundcolor','red')
           pause(1)
           rtwbuild(gcs);
           pause(1)
           set_param(bloc3,'foregroundcolor','white')
 end
 DEF(10)=0;
 set_param(gcs,'SimulationCommand','connect');          
 set_param(gcs,'SimulationCommand','start')
pause(1)
schema_modelecor=[schema_modele,'/Correcteur'];
blocsw=[schema_modelecor,'/Constant3'];
if DEF(4)==1
    set_param(blocsw,'value','1')
else
    set_param(blocsw,'value','0')
end;
bloc_plot=[schema_modelecor,'/Splot'];
set_param(bloc_plot,'parameters',num2str(DEF(3)));
bloc_plot=[schema_modelecor,'/Constant1'];
set_param(bloc_plot,'value',num2str(DEF(6)));
bloc_plot=[schema_modelecor,'/Constant2'];
set_param(bloc_plot,'value',num2str(DEF(5)));
bloc_correcteur=[schema_modelecor,'/Correc_Num'];
ajuste_temps_scope(2*DEF(2),0);
ajuste_temps_scope(2*DEF(2),1);
 
          

Contact us