Error #15300: No compiled data for the block available while generation code with target link which model includes user libraries.

6 次查看(过去 30 天)
-> 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
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:-
  1. https://www.mathworks.com/help/simulink/slref/find_system.html
  2. https://www.mathworks.com/help/simulink/slref/get_param.html?s_tid=doc_ta
  3. https://www.mathworks.com/help/simulink/slref/set_param.html?s_tid=doc_ta
Hope it helps!
  1 个评论
Aruna
Aruna 2024-6-24
Thanks for you hint. I am aware of find_system and get_param and using in other script as well, but with these funstions I am not able to get above mentioned properties of block. It will be helpfull if you provide, how can I get above mentioned(DataTypeExpr,DimentionExper) properties of input and output blcok .

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by