PROFIBUS over 802.11b

by

 

03 Nov 2003 (Updated )

Polling based PROFIBUS MAC layer over a 802.11 PHY.

wPROFIBUS_BS_menu(Block, action, varargin)
function varargout = wPROFIBUS_BS_menu(Block, action, varargin)

s = 'wPROFIBUS_BS_Init';

switch (action)
case 'init'
 
%*********************************************************************
% Switch:           cbShowMAC
% Description:       
%*********************************************************************
case 'cbShowMAC'
    disp('Set MAC Parameters')
    % -- Get variables from mask
    En   = get_param(Block, 'MaskEnables');
    Vis  = get_param(Block, 'MaskVisibilities');
    Vals = get_param(Block, 'MaskValues');
    
    % -- Set Index to Mask parameters
    setfieldindexnumbers(Block);    
    
    % -- Set Visibilities
     switch(Vals{idxMAC_preferences})        
        case 'on'
            idxOn = [idxWT_addresses idxK_value];
            [Vis{idxOn}, En{idxOn}]     = deal('on');
        case 'off'
            idxOff = [idxWT_addresses idxK_value];
            [Vis{idxOff}, En{idxOff}]   = deal('off');
     end
     
     % --- Update parameters
    set_param(Block, 'MaskVisibilities',Vis, 'MaskEnables',En);
 
    
%*********************************************************************
% Switch:           cbShowPHY
% Description:       
%*********************************************************************
case 'cbShowPHY'
    disp('Set PHY Parameters')
    % -- Get variables from mask
    En   = get_param(Block, 'MaskEnables');
    Vis  = get_param(Block, 'MaskVisibilities');
    Vals = get_param(Block, 'MaskValues');
    
    % -- Set Index to Mask parameters
    setfieldindexnumbers(Block);    
    
    % -- Set Visibilities
     switch(Vals{idxPHY_preferences})        
        case 'on'
            idxOn = [idxDatarate_menu idxPreamble_menu idxModulation_menu idxCCA_mode];
            [Vis{idxOn}, En{idxOn}]     = deal('on');
        case 'off'
            idxOff = [idxDatarate_menu idxPreamble_menu idxModulation_menu idxCCA_mode];
            [Vis{idxOff}, En{idxOff}]   = deal('off');
     end
     
     % --- Update parameters
    set_param(Block, 'MaskVisibilities',Vis, 'MaskEnables',En);    
 
%*********************************************************************
% Switch:           cbShowRF
% Description:       
%*********************************************************************
case 'cbShowRF'
    disp('Set RF Parameters')
    % -- Get variables from mask
    En   = get_param(Block, 'MaskEnables');
    Vis  = get_param(Block, 'MaskVisibilities');
    Vals = get_param(Block, 'MaskValues');
    
    % -- Set Index to Mask parameters
    setfieldindexnumbers(Block);    
    
    % -- Set Visibilities
     switch(Vals{idxRF_preferences})        
        case 'on'
            idxOn = [idxTX_powerlevel idxTX_powerlevel_vector idxAntenna_select ...
                    idxTX_noise_temp idxRRC_Rolloff_factor idxFilter_order idxOversampling_factor ...
                    idxTX_phase_noise idxTX_frequency_offset];
            [Vis{idxOn}, En{idxOn}]     = deal('on');
        case 'off'
            idxOff = [idxTX_powerlevel idxTX_powerlevel_vector idxAntenna_select ...
                     idxTX_noise_temp idxRRC_Rolloff_factor idxFilter_order idxOversampling_factor ...
                     idxTX_phase_noise idxTX_frequency_offset];
            [Vis{idxOff}, En{idxOff}]   = deal('off');
     end
     
     % --- Update parameters
    set_param(Block, 'MaskVisibilities',Vis, 'MaskEnables',En);   
    
   
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% end function varargout = wPROFIBUS_InitMask(Block, action, varargin)  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    
    
    
    
    
    
    
    

Contact us