Updating library information in script

6 Ansichten (letzte 30 Tage)
Michael Joslin
Michael Joslin am 17 Sep. 2012
Beantwortet: Abullah abutaleb am 25 Apr. 2020
I am creating a toolbox that allows others to embed user data onto some calibrations for later reporting. The block digrams they are manipulating are libraries so the changes they make will propagate to all models with links to the library. I first unlock the library using:
set_param(Library,'Lock','off')
but when I use the following command to update the library with the changes:
set_param(Library, 'SimulationCommand', 'update')
I get the following error:
??? Simulation of model Library is not allowed because it is a block diagram library.
How do I apply the changes to the library in code?

Antworten (3)

Kaustubha Govind
Kaustubha Govind am 17 Sep. 2012
"set_param(Library, 'SimulationCommand', 'update')" is used to compile block diagrams for simulation (for example, signals datatypes/sizes are figured out in this phase, amongst other important things), and does not apply to models. Do you mean that you want to force changes in the library to propagates to models using the library? I believe that should happen automatically when a model using the library blocks is opened.

Guy Rouleau
Guy Rouleau am 18 Sep. 2012
Based on your description,. it looks like you want to PROPAGATE... not update.
When looking here:
I think you need to use this param:
LinkStatus
Link status of block. Updates out-of-date linked blocks when queried using get_param.
See Check and Set Link Status Programmatically .
'none' | 'resolved' | 'unresolved' | 'implicit' | 'inactive' | 'restore' | 'propagate' | 'propagateHierarchy' | 'restoreHierarchy'

Abullah abutaleb
Abullah abutaleb am 25 Apr. 2020
Warning: Input port 1 of 'untitled/1//La1' is not connected.
Warning: Output port 1 of 'untitled/1//La1' is not connected.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be equal to or less than this value. You can disable this diagnostic by
setting 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics page of the configuration parameters dialog.
Warning: Input port 1 of 'untitled/1//La1' is not connected.
Warning: Output port 1 of 'untitled/1//La1' is not connected.
Warning: Using a default value of 0.2 for maximum step size. The simulation step size will be equal to or less than this value. You can disable this diagnostic by
setting 'Automatic solver parameter selection' diagnostic to 'none' in the Diagnostics page of the configuration parameters dialog.

Kategorien

Mehr zu Configure and View Diagnostics finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by