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.

Using initialization value in C-script

0 votes
227 views
Dear Plecs,

 

Can I use initialization value in the C-script?

The initialization value can not affect the C-script

Best regards,
asked Oct 19, 2023 by oming0731 (27 points)

1 Answer

0 votes

Values entered in the Model Initialization Commands or Mask Initialization Commands can be passed into C-Scripts using the "Parameters" field, configured in the C-Script's "Setup" tab.

From the C-Script documentation, the "Parameters" field is described as: "A comma-separated list of expressions that are passed as external parameters into the C functions. The expressions can reference workspace variables and must evaluate to scalars, vectors, matrices, 3d-arrays or strings."

You can then access the parameter entries using the ParamRealData() or ParamStringData() macros.

answered Oct 23, 2023 by Bryan Lieblick (1,909 points)
...