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,G]=y_de_x(MOGi,DEFi,Gi)
function [MOG,DEF,G]=y_de_x(MOGi,DEFi,Gi)

delete(gcf)
MOG=MOGi;
DEF=DEFi;
G=Gi;
DEF(8)=3;
switch DEF(8)
    case 3
        modele='table_y_x_essai';
        %modele='table_y_x';
end;
carte='National_Instruments/PCI-6221_37-pin';     
open_system([modele,'.mdl'])
set_param(gcs,'solver','FixedStepDiscrete')
set_param(gcs,'StartTime','0') 
set_param(gcs,'StopTime','Inf')
set_param(gcs,'SystemTargetFile','rtwin.tlc') 
%sbai=[s,'/Analog Input'];
%set_param(sbai,'drvname',carte);
%sbai1=[s,'/Analog Input1'];
%set_param(sbai1,'drvname',carte);
%sbai2=[s,'/Analog Input2'];
%set_param(sbao,'drvname',carte);
%sbai3=[s,'/Analog Input3'];
%set_param(sbao,'drvname',carte);
set_param(gcs,'SimulationMode','external');
set_param(gcs,'ExtMode','on');
duration=100000;
set_param(gcs,'ExtModeTrigDuration',duration);
etat=get_param(gcs,'simulationstatus');
MOG(1,6)=figure(1);
set(MOG(1,6),'position',ecran)

for k=1:1:2
   p_p=[0.25*(k-1)+0.125,0.34,0.05,0.02]; 
    MOG(3,1+k)=uicontrol(MOG(1,6),'style','push','unit','normalized','position',p_p,'userdata',k,...
                    'backgroundcolor','w','string',['+1cm'],'foregroundcolor','r','fontunits','normalized','fontsize',0.3,'fontweight','bold',...
                    'callback','K=get(gco,''userdata'');regle_zero2(3,K,G);'); 
   p_p=[0.25*(k-1)+0.125,0.30,0.05,0.02]; 
    MOG(4,1+k)=uicontrol(MOG(1,6),'style','push','unit','normalized','position',p_p,'userdata',k,...
                    'backgroundcolor','w','string',['-1cm'],'foregroundcolor','r','fontunits','normalized','fontsize',0.3,'fontweight','bold',...
                    'callback','K=get(gco,''userdata'');regle_zero2(4,K,G);');   
     p_p=[0.25*(k-1)+0.175,0.34,0.05,0.02]; 
    MOG(5,1+k)=uicontrol(MOG(1,6),'style','push','unit','normalized','position',p_p,'userdata',k,...
                    'backgroundcolor','w','string',['+1/2mm'],'foregroundcolor','r','fontunits','normalized','fontsize',0.3,'fontweight','bold',...
                    'callback','K=get(gco,''userdata'');regle_zero2(5,K,G);'); 
   p_p=[0.25*(k-1)+0.175,0.30,0.05,0.02]; 
    MOG(6,1+k)=uicontrol(MOG(1,6),'style','push','unit','normalized','position',p_p,'userdata',k,...
                    'backgroundcolor','w','string',['-1/2mm'],'foregroundcolor','r','fontunits','normalized','fontsize',0.3,'fontweight','bold',...
                    'callback','K=get(gco,''userdata'');regle_zero2(6,K,G);');  
    p_p=[0.25*(k-1)+0.05,0.32,0.05,0.02];
    MOG(3+k,6)=uicontrol(MOG(1,6),'style','text','unit','normalized','position',p_p,...
                    'backgroundcolor','w','string','ZERO','foregroundcolor','b','fontunits','normalized','fontsize',0.3,'fontweight','bold');
end;



choix_calibre_y={'','2 V/cm','1 V/cm','0,5 V/cm','0,2 V/cm','0,1 V/cm','50 mV/cm','20 mV/cm','VAR'};
calibre_y=[2,1,0.5,0.2,0.1,0.05,0.02,1];
k=1;
    p_y=[0.25*(k-1)+0.125,0.35,0.1,0.1];
    s='VOIE X';
    txt_y_titre=uicontrol(MOG(1,6),'style','text','unit','normalized',...
		            'position',p_y,'backgroundcolor','w',...
	                'foregroundcolor','b','fontunits','normalized','fontsize',14,'fontweight','bold','string',s);
    p_p=[0.25*(k-1)+0.125,0.30,0.1,0.1];   
    MOG(2,1+k)=uicontrol(MOG(1,6),'style','popupmenu','unit','normalized','position',p_p,...
                    'string',choix_calibre_y,'backgroundcolor','w',...
	                'foregroundcolor','r','fontunits','normalized','fontsize',14,'fontweight','bold');
k=2;                
      p_y=[0.25*(k-1)+0.125,0.35,0.1,0.1];
    s='VOIE Y';
    txt_y_titre=uicontrol(MOG(1,6),'style','text','unit','normalized',...
		            'position',p_y,'backgroundcolor','w',...
	                'foregroundcolor','b','fontunits','normalized','fontsize',14,'fontweight','bold','string',s);
    p_p=[0.25*(k-1)+0.125,0.30,0.1,0.1];   
    MOG(2,1+k)=uicontrol(MOG(1,6),'style','popupmenu','unit','normalized','position',p_p,...
                    'string',choix_calibre_y,'backgroundcolor','w',...
	                'foregroundcolor','r','fontunits','normalized','fontsize',14,'fontweight','bold');  

MOG(12,1)=uicontrol(MOG(1,6),'style','text','unit','normalized','position',[0.01,0.18,0.05,0.025],...
           'backgroundcolor','w','string','Filtrage ?','foregroundcolor','b','fontunits','normalized','fontsize',14,'fontweight','bold');

for k=1:1:2
    p_p=[0.25*(k-1)+0.125,0.18,0.05,0.02]; 
    s={'','NON','OUI'};
    MOG(11,1+k)=uicontrol(MOG(1,6),'style','popupmenu','unit','normalized','position',p_p,'userdata',k,...
                    'backgroundcolor','w','string',s,'foregroundcolor','r','fontunits','normalized','fontsize',12,'fontweight','bold',...
                    'callback','K=get(gco,''userdata'');MOG=nombre_point(MOG,K);'); 
end;


MOG(8,1)=uicontrol(MOG(1,6),'style','push','unit','normalized',...
		'position',[0.9 0.9 0.1 0.05],...
	    'string','OK','foregroundcolor','r','fontunits','normalized','fontsize',18,'fontweight','bold',...
        'KeyPressFcn',{@lance_enregistrement,MOG},...
        'callback','[MOG,DEF,G]=lance_tt_xy(MOG,DEF,G)');
MOG(9,1)=uicontrol(MOG(1,6),'style','push','unit','normalized',...
		'position',[0.9 0.8 0.1 0.05],...
	    'string','STOP','foregroundcolor','r','fontunits','normalized','fontsize',18,'fontweight','bold',...
        'callback','[MOG,DEF,G]=stop_tt(MOG,DEF,G);');
MOG(10,1)=uicontrol(MOG(1,6),'style','push','unit','normalized',...
		'position',[0.9 0.7 0.1 0.05],...
	    'string','MENU','foregroundcolor','r','fontunits','normalized','fontsize',18,'fontweight','bold',...
        'callback','close_system(gcs,0);[MOG,DEF,G]=table_menu(MOG,DEF,G);');

MOG(11,1)=uicontrol(MOG(1,6),'style','push','unit','normalized',...
		'position',[0.9 0.6 0.1 0.05],...
	    'string','FIN','foregroundcolor','r','fontunits','normalized','fontsize',18,'fontweight','bold',...
        'callback','[MOG,DEF,G]=stop_tt(MOG,DEF,G);close_system(gcs,0);');


Contact us