Model reference limitations

4 views (last 30 days)
Sean
Sean on 11 Jun 2012
Hi, I am having trouble getting two models I created into a library as a model reference. Both blocks work fine normally. It would be ideal to have them as model reference to reduce the size of the generated code.
The first block has a mask on it that allows the user to give the name of a signal object in the workspace to a data store read/write block. The mask promotes the DataStoreName and DataStoreElements parameters of the data store read/write blocks to a mask dialog parameter that allows the user to define the data store name. The problem is it doesn't seem to be possible to promote these from the mask of the referenced block to the mask of the model reference block. It also seems that signal-type variables in the model workspace cannot be passed in as model arguments, but it doesn't matter since the data store read and write blocks need to have their parameters promoted to the model reference mask anyway. Has anyone overcome this before?
The second block has a dynamic mask that creates and deletes blocks in the model with a callback function and uses a user defined number of inputs. I can't seem to get the past the model reference path and into the referenced block. For example, the model reference block is called "BitPack16_Ref", the referenced model is called "BitPack16" and the model using the block is called "DataWrite". The call back path is 'DataWrite/BitPack16_Ref'. If I tried to get a the name of the input port at the top level of BitPack16, the path should be 'DataWrite/BitPack16_Ref/BitPack16/In1', correct? This throws an Invalid Simulink Object Name error every time. Is it not possible to read/write to a referenced model?

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!