TSL Automation Solutions Logo

Section 15.4.3 · Chapter 15: Using Macros

Arithmetic Operation

■ Addition ( + )

Format P1 = P2 + P3 Data Type U/S/UD/SD/F
Function Adds P2 and P3 and saves the result in P1.
P1 (I/E) The location to save the result.
P2,P3 (I/E/C/AE) The operands.
Example 1 $U100 = $U101 + $U102 (U)
Example 2 W100 = 0.3*$U0 + 0.1*$U2 + 0.6*$U4 (F)

■ Subtraction ( - )

Format P1 = P2 - P3 Data Type U/S/UD/SD/F
Function Subtracts P3 from P2 and saves the result in P1.
P1 (I/E) The location to save the result.
P2,P3 (I/E/C/AE) The operands.
Example 1 $U100 = $U101 - $U102 (U)
Example 2 W100 = 0.3*$U0 - 10.75 (F)

■ Multiplication ( * )

Format P1 = P2 * P3 Data Type U/S/UD/SD/F
Function Multiplies P2 by P3 and saves the product in P1.
P1 (I/E) The location to save the product. If the product overflows, the higher bits exceeding the limit will be truncated and the remaining bits will be stored in P1.
P2,P3 (I/E/C/AE) The operands.
Example 1 $U100 = $U102 * 0x192
Example 2 W100 = ($U0 + $U2) * ($U4 + $U6) (F)

■ Division ( / )

Format P1 = P2 / P3 Data Type U/S/UD/SD/F
Function Divides P2 by P3 and saves the quotient in P1.
P1 (I/E) The location to save the result.
P2,P3 (I/E/C/AE) The operands.
Example 1 $U100 = $U101 / $U102 (U)
Example 2 W100 = ($U0 + $U2) / ($U4 + $U6) (F)

■ Modulus ( % )

Format P1 = P2 % P3 Data Type U/S/UD/SD
Function Divides P2 by P3 and saves the remainder in P1.
P1 (I/E) The location to save the result.
P2,P3 (I/E/C/AE) The operands.
Example 1 $U100 = $U30 % 16(U)
EExample 2 W100 = $U200 % ($U402 + $U106) (SD)

Need PM Designer itself?

V4 for current PK, PT, ITV and PM panels, V2 for older models. Free, sent by email.

Source.Section 15.4.3 of the PM Designer Software User Manual, Edition 2.0, © Cermate Technologies Inc. (www.cermate.com, service@cermate.com). Reproduced online, with the manual's own figures, by TSL Automation Solutions, authorised Cermate distributor, for users of Cermate HMI panels. PM Designer and PanelMaster are trademarks of Cermate Technologies Inc.

Text and figures are the manufacturer's and may describe features your panel or software version does not have. For a plain-language introduction read the PM Designer guide; for help with a specific panel contact TSL Automation.