Error #15300: No compiled data for the block available while generation code with target link which model includes user libraries.
显示 更早的评论
-> I am doing automation on simulink model which includes targetlink blocks(which also have user defined library blocks). As per my requirement I am editing library model as well and trying to generate code. If my model includes Library models which have function block the code genetation is not happening and throughing Error #15300 error. I have crosschecked my libraries are saved correctly and all the links are correct in model as well.
I fould some unintentional changes on inport and outport blocks after I run my script on model.Please find below higlighted properties which are updating without intention.If I retaine these chages and generating code its susscessfully generating.
Could any one please help how these settings are getting modified and how can we access these propertis trhough script. Info:these are targetlink port used inside simulink model.
回答(1 个)
Karan Singh
2024-6-20
Hi Aruna,
While I am unsure about how your script changes the configuration settings, which would require a deep analysis of your script, I can guide you on how to access and modify a property within your script.
- First, you need to identify the "inport" and "outport" blocks in your Simulink model. This can be achieved using the "find_system" function or by iterating through the blocks in the model
% Example to find all inport blocks
inports = find_system('YourModelName', 'BlockType', 'Inport');
- Once you have identified the ports, you can access and modify their properties using the "get_param" and "set_param" functions.
% Example to get and set properties of an inport block
portHandle = get_param(inports{1}, 'Handle');
currentDataType = get_param(portHandle, 'DataType');
% Modify properties if needed
set_param(portHandle, 'DataType', 'double'); % Example modification
For further reading and to understand more about how to use these functions, here are the documentation links you can access:-
- https://www.mathworks.com/help/simulink/slref/find_system.html
- https://www.mathworks.com/help/simulink/slref/get_param.html?s_tid=doc_ta
- https://www.mathworks.com/help/simulink/slref/set_param.html?s_tid=doc_ta
Hope it helps!
类别
在 帮助中心 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!