Error when using (self created) library block in a model

2 次查看(过去 30 天)
I have created a block in a library.
This block works (correct / expected behavior) when I try it in library directly.
But when I import the block in a model, I got error: parameter callback errors.
The block behavior is to modify its content (remove or add block inside) according to parameter values.
It can works in model if i cut the link to the library, but after I got lot of warning from advisor ...

采纳的回答

Yohann GOYER
Yohann GOYER 2024-6-14
I got answer from matlab support and I share it here.
In fact the code was in the parameter callback.
But the code shall be place under intitialize callback instead.
After doning that, block works without problem.

更多回答(1 个)

Fangjun Jiang
Fangjun Jiang 2024-5-30
编辑:Fangjun Jiang 2024-5-30
Follow this.
If possible, don't do delete_block() and add_block(). Using replace_block() might work.

类别

Help CenterFile Exchange 中查找有关 Model, Block, and Port Callbacks 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by