Blockset masked circuit with fewer parameters in mask

Hello all,

I’ve created a subcircuit in a masked configurable library block; the circuit has 8-10 components depending on configuration. I intend to use multiple of these blocks in a single simulation. Is there a way to pass variables from the Matlab workspace to the blocks without putting them in the mask dialog parameters? Ideally, I’d like some of them in the mask and others preset.

Thanks,

Youssef

It’s not exactly what I wanted but a workaround is to create the masked model in the library file and then to set the matlab parameters in the mask dialog boxes within that library file. This effectively “preloads” the dialog boxes for every new instance of the subcircuit. Its not perfect but it makes adding a new subcircuit a bit easier. Using the tabs for organization is also necessary with this many params so I appreciate that feature.

Thanks for sharing your solution. As you discovered, PLECS associates a local variable workspace with each masked subsystem that has one or more mask parameters defined. Components in the underlying schematics can access only variables that are defined in this mask workspace.

Still there is quite a bit of flexibility in the mask. If some of the parameters are related to each other through calculations you can pass in the “high-level” parameters and determine the “low-level” parameters in the Mask Initialization commands. Alternatively, if the value is always constant and will never change, you can just define that in the Mask Initialization commands and not pass it through as a mask variable.

The Mask Initialization commands are also quite flexible in that you could even pass in a reference to a *.mat file with the variables defined or a *.m file as a string and execute it.