Download User's Guide ®

Transcript
4
Other Components
4.1
Parameter File
The parameter file element defines the name of the file that stores the component parameters and limit settings.
For example, the resistance of a resistor can be specified as R1, and the value of R1 is defined in a parameter
file.
Image:
The parameter file is a text file created by the user. The format is shown below:
<name> = <value>
% Add comment here
(global) <name> = <value> % Definition "(global)" is used in SimCoder only
<name> <value>
// Add comment here
LIMIT <name> <lower limit> <upper limit>
% Comment
// Comment
The field <value> can be either a numerical number (e.g. “R1 = 12.3”) or a mathematical expression (e.g. “R3 =
R1 + R2/2.”). The name and the value can be separated by either an equation sign (e.g. “R1 = 12.3”) or a space
(e.g. “R1 12.3”). Text from the character % or // to the end of the line is treated as comments (e.g. “% R3 is the
load resistance”).
The definition "(global)" is used in SimCoder only for automatic code generation. Please refer to the SimCoder
User Manual on how it is used. For PSIM simulation, this definition is ignored. That is, a parameter definition
"(global) Kp = 1.2" is treated the same as "Kp = 1.2".
For example, a parameter file may look like the following:
R1=12.3
%R1 is defined as 12.3
R2 23.4Ohm
%Equation sign can be replaced by space
% Comment starts with either % or //
R3=R1+R2/2.
//Math expression is allowed
L1=3m
//power-of-ten suffix is allowed. L1=0.003
C1=100uF
LIMIT R3 5. 25.
%R3 is limited between 5. and 25.
When PSIM saves the schematic that contains the parameter file element, it will save the information of both
the relative path and absolute path of the parameter file, as well as a copy of the content of the parameter file.
When PSIM loads a schematic with the parameter file element, it will search and load the parameter file in the
following order: relative path (relative to the schematic file), absolute path, and the local path (the local folder
where the schematic file is). If PSIM still can not find the parameter file, it will create the parameter file in the
local schematic folder from the copy that it saved in the schematic file.
Chapter 4: Other Components
137