SDO configuration parameters same to not correctly be evaluated by the Generic 
Slave (simulink ethercat block).
Only the first row of the SDO configuration matrix will be correctly configured.

I found a solution to this problem by modifing the Generic Slave mask 
(initialization script) to:

.... some code...

SdoConfig = [];
if isempty(sdo_config)
    SdoConfig = [];
elseif isnumeric(sdo_config) && size(sdo_config,2) == 4
    SdoConfig = cell2struct(...
    num2cell(sdo_config),...
    {'Index' 'SubIndex' 'BitLen' 'Value'}, 2);
elseif isstruct(sdo_config)
    SdoConfig = sdo_config;
else
    errordlg([gcb ':Value Sdo Config must be a numeric M-by-4 '...
        'matrix [Index SubIndex BitLen Value] '...
        'or a structure vector with the fields '...
        '''Index'', ''SubIndex'', ''BitLen'' and ''Value''']);
end

.... some code...


the original code was:

.... some code...

SdoConfig = [];
if isempty(sdo_config)
    SdoConfig = [];
elseif isnumeric(sdo_config) && size(sdo_config,2) == 4
    SdoConfig = struct(...
        'Index', sdo_config(:,1), ...
        'SubIndex', sdo_config(:,2), ...
        'BitLen', sdo_config(:,3),...
        'Value', sdo_config(:,4));
elseif isstruct(sdo_config)
    SdoConfig = sdo_config;
else
    errordlg([gcb ':Value Sdo Config must be a numeric M-by-4 '...
        'matrix [Index SubIndex BitLen Value] '...
        'or a structure vector with the fields '...
        '''Index'', ''SubIndex'', ''BitLen'' and ''Value''']);
end

.... some code...
_______________________________________________
etherlab-dev mailing list
[email protected]
http://lists.etherlab.org/mailman/listinfo/etherlab-dev

Reply via email to