Building a library part from scratch
From within Simulink, select File:New:Library.
- If you are:
- building a library part from scratch:
- In the new empty model file, build your model from "approved" CDS parts (CDS_PARTS) or other CDS user library parts.
- Once you have a model, select the entire model and "create subsystem". The library part should be a single subsystem enclosing your entire model.
- Give the inputs and outputs sensible names.
- building a library part from an existing model subsystem:
- Open the model that contains the subsystem that you wish to make into a library part.
- Copy or cut the subsystem block out of the model, and paste it into the new empty library model.
- building a library part from scratch:
- Give the subsystem block a sensible unique name in the library (see notes below).
Save the library file with a sensible name, in the appropriate cds_user_apps/<subsystem>/common directory.
To add the new library part to a model, open the library part file and drag the part into the model. DO NOT cut/copy paste (this will break the link to the library part).
Notes about library parts
- The library file path and part name (path/part) is how the parser finds the part. Library file names or part names can not be changed after the fact without modifying all models that link to this part. Choose names wisely.
The name of a library part can be changed after the part is included/linked/dragged into a model file.
- At the moment (2011/06/02) there is a bug such that library parts and the files that they are saved in can not have identical names. This is a bug that will hopefully be fixed soon.
