How to change input values in the midst of simulation?

I’m trying to simulate some faults using the BLDC Circuit in the PLECS Library. One of the faults is instantaneous power stop, which is pretty much a loss of power in the midst of the simulation. However, I am unable to figure out how to change input parameters during simulations or set a specific timestep where the value changes. I’ve looked into C-script and doesn’t look like it could do what I require. Below is the attached file, I plan to change the Udc to 0 in the midst of simulation to replicate an instantaneous power stop fault. Please advice on the situation.

> Below is the attached file

It seems you did not attach a model as you intended.

> I plan to change the Udc to 0 in the midst of simulation to replicate an instantaneous power stop fault. Please advice on the situation.

Block mask parameters are static during a simulation run unless manually changed by the user during run-time. For example, the “Voltage Source (DC)” block has one parameter that defines the DC voltage.

Signals in the PLECS schematic are intended to update dynamically during a simulation run. A straightforward way to set the voltage to zero would be a “Step” block connected to a “Voltage Source (Controlled)” block, with a voltage step from Udc to 0.

If you have a more sophisticated voltage profile, then a look-up table or “From File” block might be appropriate. See this forum post for an example of the From File approach. There also the “Motor Drive with Failure Modes” PLECS Demo Model may be relevant for your work…