This article aims to present a way to pass a variable defined in a PSIM parameter file into a Simplified C block. Let us consider a simple constant block as input to a Simplified C block and a parameter file in a PSIM simulation, as shown in following figure. Double-clicking a parameter file will open it and a user can then enter parameters.
We can set variables saved in a parameter file as global variables in a Simplified C block inside PSIM. For this, open the Simplified C block and click Variables. This opens a dialogue box, where a user should write the variables used in the parameter file and click OK. Now these variables can be used as global variables in the Simplified C block. This can be seen from the following figure:
By running the simulation, we can see that output is 4 (Asper the example considered for this).
Simulation Files:
Learn More:
- Insights into the PSIM C Block: Differences between the simplified and regular one - Insert GetPsimValue & InsertSetRunTimeValue functions
- How to Use Parameter Files in PSIM