What are Transfer Function and Script Expression Syntax rules in Proteus

Transfer function expression and Script are used in Proteus to model behavior of a component for simulation. The behavior of Primitives like current sources ACS (ACCS, AVCS), voltage sources AVS (AVCVS, ACCVS), VSWITCH etc. are modelled using Transfer function. Similarly, Script is used to define numerical values to mapped values and also write evaluation equations. So, what are the syntax rules to write the transfer function and script in Proteus Professional.

Transfer Function and Script Expression Syntax rules in Proteus

The following rules and syntax guidelines for writing transfer functions (property expressions) and writing scripts are based on the Proteus ISIS manual:

1. Rules for Transfer Function Syntax (Property Expression Evaluation)

Transfer functions/expressions are used in parameterized circuits to calculate component values dynamically.

Syntax & Functions

Expressions must use one of three specific keywords followed by a mathematical formula in parentheses:

  • EVAL(...) – Evaluates the expression directly without rounding.

  • E12(...) – Evaluates the expression and rounds the result to the nearest standard E12 series value.

  • E24(...) – Evaluates the expression and rounds the result to the nearest standard E24 series value.

Spacing, Operators, and Variables

  • Spaces allowed between operators and variables? Yes. Spaces are permitted between numbers, variables (sheet properties), and arithmetic operators (e.g., E12(1/(2*PI * IMP * FREQ)) or E24( 3 + 4 * 5 )).

  • Supported Operators: Mathematical expressions can include addition (+), subtraction (-), multiplication (*), division (/), and standard parentheses () for overriding operator precedence.

  • Unit Suffixes: Standard engineering multipliers (like k for thousands) can be attached directly to numbers inside the expression (e.g., 20k is automatically treated as 20000).

  • Variables: Expressions can reference named sheet properties (e.g., PI, FREQ, IMP).

  • Limitations:

    • The evaluator only supports numeric values; text/string expressions are not allowed.

    • Standard mathematical functions (such as sin, cos, sqrt) are not supported.

2. Rules for Writing User Properties and Scripts

User Property Syntax

Properties consist of a keyword and a value separated by an equals sign:

$$\text{KEYWORD}=\text{value}$$
  • Rule on Spaces: Keywords should generally consist of letters, numbers, and underscores only. Under no circumstances should keywords contain spaces, commas, double quotes, or equals signs.

  • Hidden Properties: If a property assignment is wrapped in curly brackets {...}, it will be defined but hidden from display on the schematic (e.g., {PRIMITIVE=DIGITAL}).

  • Property Substitution: Enclosing a property name in chevrons inside an assignment (e.g., PACKAGE=<C1_PACKAGE>) acts as a literal text substitution macro referencing a sheet property.

Script Block Syntax

Scripts are entered as multiline text blocks on a sheet.

  • Command Names: Script block definitions begin with an asterisk (*), such as *DEFINE.

  • Structure:

    Plaintext
    *DEFINE
    PI=3.142
    FREQ=10k
    

    Each assignment following the command header is written on a single line.

Related:

Post a Comment

Previous Post Next Post