Choose configurable substem from Python

Hi,

With the xml-rpc interface, I would like to know if it would be possible to specify/change the configuration of a configurable subsystem in a PLECS model directly from Python.

If not, is there any similar alternative while maintaining the decision with python?

Thank you.

Best regards,

There are two approaches which apply to setting parameters in general:

  1. You can set the active configuration by reference. For example create a variable in your Model Initialization commands and the assign that variable using the ModelVars technique. See the “Overview of RPC Commands” section in the manual and the “Buck Converter with Parameter Sweep” demo model for further details.
  2. You can modify your model using the plecs.set('componentPath', 'parameter', 'value') where the component path is the subsystem, the parameter must be set to Configuration and the value can either be the configuration index (e.g. 1,2,3…) or the name of the configuration. Note value is always a string.

Note that option 1 does not modify the *.plecs model while option 2 does.