Register mpt User Object Types

1 view (last 30 days)
culsion c
culsion c on 21 Nov 2018
Answered: Yunyan He on 23 Nov 2020
when I use the example as below in matlab2018a,it can not work.
Example 1. sl_customization.m for mpt Object Type Customizations
function sl_customization(cm)
% Register user customizations
% Get default (factory) customizations
hObj = cm.slDataObjectCustomizer;
% Add commonly used signal types
hObj.addMPTObjectType(...
'EngineType','Signal',...
'DataType', 'uint8',...
'Min', 0,...
'Max', 255,...
'Unit','m/s');
hObj.addMPTObjectType(...
'FuelType','Signal',...
'DataType', 'int16',...
'Min', -12,...
'Max', 3000,...
'Unit','mg/hr');
end

Answers (2)

culsion c
culsion c on 22 Nov 2018
>> sl_refresh_customizations
> # # # MPT1 Load Successfully! # # #
警告: 未定义与 'DAStudio.CustomizationManager' 类型的输入参数相对应的函数 'slDataObjectCustomizer'。
> In slCustomizer/callAll
In slCustomizer/refresh
In slCustomizer.staticRefresh
In sl_refresh_customizations (line 22)
so,maybe there is not 'slDataObjectCustomizer' function is matlab2018a.

Yunyan He
Yunyan He on 23 Nov 2020
The capability to use slDataObjectCustomizer and addMPTObjectType were deprecated around R2015a.
Please follow steps to create your own storage class based per the documentation. https://www.mathworks.com/help/ecoder/ug/design-custom-storage-classes-and-memory-sections.html#buq4dqk-1

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!