Parameter Expressions

Sepasoft MES Module Suite

Adding Parameter Expressions

In Batch Recipe Editor, you can add and edit parameter expressions under the Calculation field of a parameter's edit dialog. The purpose of the calculation field here is to perform mathematical expressions during batch execution. Keep in mind that within batch execution speed is important and that parameter expressions here may be called frequently.

One line of Python code is accepted. System functions are not available for use in the one line of code. This means that you cannot access tags, execute DB queries, etc. The Script Phase is the correct method to do more extensive Python scripting because it is not repeatedly executed (unless you intentionally do so in the Batch Recipe). The lifecycle of a Script Phase can be tracked for troubleshooting.

See Referencing Parameters in Batch Recipes: Syntax

Note After the first execution, the calculation is updated whenever a parameter (set as a factor in the calculation) changes. 

When an expression is entered (via Recipe Editor or scripting) that has circular references an error is returned and the recipe is flagged invalid and cannot be run.

Warning

Not supported in a Calculation Expression:

  • Assignment operators 
  • Conditional expressions 
  • Bitwise operators

Supported Python Operators

+
Addition
- Subtraction
*Multiplication
/Division
%Modulus
**Exponentiation
//Floor division
==Equal
!=Not equal
>Greater than
>=Greater than or equal to
< Less than
andReturns True if both statements are true
orReturns True if one of the statements is true
notReverse the result, returns False if the result is true
inReturns True if a sequence with the specified value is present in the object
not inReturns True if a sequence with the specified value is not present in the object

Sepasoft MES Module Suite