Please take a minute to review and accept our Terms of Use.
Welcome to PLECS User Forum, where you can ask questions and receive answers from other members of the community.

Scripts + Storing value

+1 vote
33 views
Hello,

Is there a way to store a value in a simulation run that I can then use for the next simulation (both simulation runs via script).

Munadir
asked Feb 1 by munadir (24 points)

1 Answer

+2 votes
 
Best answer

Hi,

you can place an output port on your top level schematic. When you run plecs('simulate') it returns the values of the signals that are connected to top-level output ports. These values can then be assigned to variables in the next simulation run (using the ModelVars struct in the simulate command).

Kind regards,

Oliver

answered Feb 1 by Oliver Schwartz (34 points)
selected Feb 1 by munadir
Thanks! That was helpful. I hacked up one of the PLECS demo models and am attaching it.
...