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

Many technical questions regarding PLECS are answered on the Technical Solutions page of our website. Tutorial videos, specific application examples, and pre-recorded webinars are available on our YouTube page. Please follow us on LinkedIn for the latest Plexim news.

Importing a parameter in Simulation script and using it as a variable.

0 votes
Hello PLECS users/team,

I am fairly new to PLECS and struggling with calling a variable from my simulation into the simulation script. I am able to call the variable from initialization but not from the simulation. My aim is to call a parameter which is generated in PLECS and use it as a variable inside the simulation script. I have tried plecs('get', ..) command however I am not successful.

Kindly let me know how it can be done. Thanks in advance.
asked Aug 10, 2020 by Mayuchip (12 points)
Some of the terminology you're using is not clear to me.

Can you post a simple model showing what you are trying to do?  It's ok if you need to use dummy variables or include in a code comment "I would like to access variable 'x' here".

1 Answer

0 votes

As Bryan pointed out it's not very clear what you're attempting to do. However, from what I understood I attached a simple example for you.

To retrieve the results from the PLECS simulation to your simulation script, you can either use a scope block or a signal outport block. In the attached example, we calculate the duty cycle "d" of a boost converter from the PLECS simulation, which we can then use in the script for post-processing, or use this value in a second PLECS simulation. Is this similar to what you're intending to do?

answered Aug 12, 2020 by Manu Parimi (363 points)