MATLAB: Three-Phase Fault Parameter Values of Simulink Model in Real-Time Target

fault resistance ronmask editorreal timesetparamsimpowersystemsSimscape ElectricalsimulinkSimulink Real-Timesimulnkthree-phase fault

Hello, I am using a SimPowerSystems part called Three-Phase Fault in a Simulink model which I am running on a Real-Time target.
I wish to change the value of a parameter of the Three-Phase Fault block, the Fault resistance value, between runs without recompiling the model on the target.
When I examine the Real-Time Target object to see the parameter list, I can't see this parameter to modify and looking at the block with the Mask Editor, the parameter attribute is not ticked as tunable.
How can I make this parameter adjustable using setparam like many of its other variables?
Do I have to create a custom version of this part by breaking its reference to the original library part or is there another method which will work, like setting a global variable that the target will examine before each run.
Thank you in advance for your suggestions.

Best Answer

Hi everyone,
I worked out how to do this. I created a block where I used the SimPowerSystems parts Variable Resistor, Solver Configuration, Single Phase Switch, Current-Voltage Simscape Interface, Electrical Reference and two Simulink->PS Converter Blocks to achieve this functionality.
The Resistance comes via a constant into a port and is converted from Simulink signal to a physical signal via the Simulink->PS block and adjusts the value of the variable resistor on the +ssc and -ssc side of the current to voltage simscape interface block. On the simscape side there is a single phase switch which has its control signal passed the same way as the resistance.
This can be then used to change the value of the fault resistance on the target using the setparam command without recompiling the real time target model.