TSL Automation Solutions Logo

Section 15.4.21 · Chapter 15: Using Macros

Math Operation

■ ACOS

Format P1 = ACOS( P2 ) Data Type F
Function Calculates the arccosine of the value of P2 and saves the result to P1.
P1 (I) The result in the range 0 to π. If the value of P2 is less than -1 or greater than 1, the result will be an indefinite by default.
P2 (I/C) The value between -1 to 1 whose arccosine is to be calculated.
Example 1 $U100 = 0 (F) /* Assign 0 to $U100 (and $U101)*/
$U200 = ACOS($U100) (F) /* Write the result 1.570796 of arccosine of 0 to $U200 (and $U201)*/

■ ASIN

Format P1 = ASIN( P2 ) Data Type F
Function Calculates the arcsine of the value of P2 and saves the result to P1.
P1 (I) The result in the range -π/2 to π/2. If the value of P2 is less than -1 or greater than 1, the result will be an indefinite by default.
P2 (I/C) The value between -1 to 1 whose arcsine is to be calculated.
Example 1 $U100 = -0.5 (F) /* Assign -0.5 to $U100 (and $U101)*/
$U200 = ASIN($U100) (F) /* Write the result -0.523599 of arcsine of -0.5 to $U200 (and $U201)*/

■ ATAN

Format P1 = ATAN( P2 ) Data Type F
Function Calculates the arctangent of the value of P2 and saves the result to P1.
P1 (I) The result in the range -π/2 to π/2. If the value of P2 is 0, the result will be 0.
P2 (I/C) The value whose arctangent is to be calculated.
Example 1 $U100 = 236.89 (F) /* Assign 236.89 to $U100 (and $U101)*/
$U200 = ATAN($U100) (F) /* Write the result 1.566575 of arctangent of 236.89 to $U200 (and $U201)*/

■ ATAN2

Format P1 = ATAN2( P2,P3 ) Data Type F
Function Calculates the arctangent of the value of P2 / P3 and saves the result to P1.
P1 (I) The result in the range -π to π. If the value of P2 and P3 both are 0, the result will be 0.
P2 (I/C) The value whose arctangent is to be calculated.
P3 (I/C) The value whose arctangent is to be calculated.
Example 1 $U100 = 60 (F) /* Assign 236.89 to $U100 (and $U101)*/
$U102 = 3 (F) /* Assign 236.89 to $U100 (and $U101)*/
$U200 = ATAN($U100,$U102) (F) /* Write the result 1.520838 of arctangent of 60/3 to $U200 (and $U201)*/

■ COS

Format P1 = COS( P2 ) Data Type F
Function Calculates the cosine of the value of P2 and saves the result to P1.
P1 (I) The result in the range -1 to 1.
P2 (I/C) The angle in radians whose cosine is to be calculated.
Example 1 $U100 = 1.570796 (F) /* Assign 1.570796 to $U100 (and $U101)*/
$U200 = COS($U100) (F) /* Write the result 0 of cosine of 1.570796 to $U200 (and $U201)*/

■ SIN

Format P1 = SIN( P2 ) Data Type F
Function Calculates the sine of the value of P2 and saves the result to P1.
P1 (I) The result in the range -1 to 1.
P2 (I/C) The angle in radians whose sine is to be calculated.
Example 1 $U100 = 1.570796 (F) /* Assign 1.570796 (2/π) to $U100 (and $U101)*/
$U200 = SIN($U100) (F) /* Write the result 1 of sine of 1.570796 to $U200 (and $U201)*/

■ TAN

Format P1 = TAN( P2 ) Data Type F
Function Calculates the tangent of the value of P2 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The angle in radians whose tangent is to be calculated.
Example 1 $U100 = 0.785398 (F) /* Assign 0.785398 to $U100 (and $U101)*/
$U200 = TAN($U100) (F) /* Write the result 1 of tangent of 0.785398 to $U200 (and $U201)*/

■ EXP

Format P1 = EXP( P2 ) Data Type F
Function Calculates the exponential of the value of P2 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The floating point parameter whose exponential is to be calculated.
Example 1 $U100 = 2.302585 (F) /* Assign 2.302585 to $U100 (and $U101)*/
$U200 = EXP($U100) (F) /* Write the result 10 of exponential of 2.302585 to $U200 (and $U201)*/

■ LOG

Format P1 = LOG( P2 ) Data Type F
Function Calculates the natural (base-e) logarithms of the value of P2 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The floating point parameter whose logarithm is to be calculated.
Example 1 $U100 = 9000 (F) /* Assign 9000 to $U100 (and $U101)*/
$U200 = LOG($U100) (F) /* Write the result 9.104980 of logarithms of 9000 to $U200 (and $U201)*/

■ LOG10

Format P1 = LOG10( P2 ) Data Type F
Function Calculates the common (base-10) logarithms of the value of P2 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The floating point parameter whose logarithm is to be calculated.
Example 1 $U100 = 9000 (F) /* Assign 9000 to $U100 (and $U101)*/
$U200 = LOG10($U100) (F) /* Write the result 3.954242 of logarithms of 9000 to $U200 (and $U201)*/

■ POW

Format P1 = POW(P2,P3 ) Data Type U
Function Calculates P2 raised to the power of P3 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The base value.
P3 (I/C) The exponent value.
Example 1 $U100 = 2 (F) /* Assign 2 to $U100 (and $U101)*/
$U102 = 3 (F) /* Assign 3 to $U102 (and $U101)*/
$U200 = POW($U100,$U102) (F) /* Write the result 8(2 to the power of 3 is 8) to $U200 (and $U201)*/

■ SQRT

Format P1 = SQRT( P2 ) Data Type F
Function Calculates the square root of the value of P2 and saves the result to P1.
P1 (I) The result.
P2 (I/C) The nonnegative floating point value whose square root is to be calculated.
Example 1 $U100 = 45.35 (F) /* Assign 45.35 to $U100 (and $U101)*/
$U200 = SQRT($U100) (F) /* Write the result 6.73 of square root of 45.35 to $U200 (and $U201)*/

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.21 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.