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

2 visualizaciones (últimos 30 días)
Yohann GOYER
Yohann GOYER el 30 de Mayo de 2024
Respondida: Yohann GOYER el 14 de Jun. de 2024
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 ...

Respuesta aceptada

Yohann GOYER
Yohann GOYER el 14 de Jun. de 2024
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.

Más respuestas (1)

Fangjun Jiang
Fangjun Jiang el 30 de Mayo de 2024
Editada: Fangjun Jiang el 30 de Mayo de 2024
Follow this.
If possible, don't do delete_block() and add_block(). Using replace_block() might work.

Categorías

Más información sobre Model, Block, and Port Callbacks en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by