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_RdeP.m
nom=get_param(gcs,'name');
schema_modele='boucle_fermee_anal_RdeP';
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_anal_RdeP';
    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);
    sbao=[s,'/Analog Output'];
    set_param(sbao,'drvname',carte_sortie);
    set_param(sbao,'voltrange',plage_sortie);
    bloc_sat=[schema_modele,'/Correcteur/RdeP/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_RdeP=[schema_modelecor,'/RdeP'];
bloc_R=[schema_modele,'/R'];
try
    set_param(bloc_RdeP,'NUMZ',['[',num2str(P_RdeP(3,:),'%24.15e'),']']);
    set_param(bloc_RdeP,'DENZ',['[',num2str(P_RdeP(4,:),'%24.15e'),']']);
    set_param(bloc_R,'NUM',['[',num2str(P_RdeP(1,:)),']']);
    set_param(bloc_R,'DEN',['[',num2str(P_RdeP(2,:)),']']);
catch
    set_param(gcs,'simulationcommand','stop')
    pause(1)
     set_param(bloc_RdeP,'NUMZ',['[',num2str(P_RdeP(3,:),'%24.15e'),']']);
    set_param(bloc_RdeP,'DENZ',['[',num2str(P_RdeP(4,:),'%24.15e'),']']);
    set_param(bloc_R,'NUM',['[',num2str(P_RdeP(1,:)),']']);
    set_param(bloc_R,'DEN',['[',num2str(P_RdeP(2,:)),']']);
end;

if faut_il_recompiler
    bloc3=[schema_modele,'/compil'];
	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;
nom=[get_param(gcs,'name'),'/Correcteur'];
bloc_plot=[nom,'/Splot'];
set_param(bloc_plot,'parameters',num2str(DEF(3)));
bloc_RdeP=[schema_modelecor,'/RdeP'];
 set_param(bloc_RdeP,'NUMZ',['[',num2str(P_RdeP(3,:),'%24.15e'),']']);
 set_param(bloc_RdeP,'DENZ',['[',num2str(P_RdeP(4,:),'%24.15e'),']']);
 bloc_R=[schema_modele,'/R'];
 set_param(bloc_R,'NUM',['[',num2str(P_RdeP(1,:)),']']);
  set_param(bloc_R,'DEN',['[',num2str(P_RdeP(2,:)),']']);
 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)));
ajuste_temps_scope(2*DEF(2),0);
 

Contact us