Hi,
is it possible to select the configuration of a configurable subsystem in a model running in RT Box via the json-rpc interface? I know it is probably not possible to switch at runtime after the model is started, but it would be nice to be able to select between different variants of subsystems, e.g. during model load, a bit like it is described for simulations here.
You can assign a variable override the Model Initialization Command value at the time of code generation. Refer to the Code Generation section of the PLECS Manual:
plecs.codegen('path', optStruct, 'outputDir')
where path is a model name or a subsystem path. The parameters optStruct and outputDir are optional.
If optStruct is provided, it is expected to be a struct as described in Scripted Simulation and Analysis Options. This enables you e.g. to generate code for different parameter values without having to modify the model file.
Another approach would be a two-step process where you use the set command to change the Configuration field of the subsystem and then generate the code after.