Table Of Contents

Calculation Formula Options

Last Modified: September 14, 2018

Use standard math operators, functions, and constants to customize existing hardware channels in the system.

All formulas must adhere to the following rules:
  • Every formula must contain a reference to at least one channel.
  • Channel references must be contained within single quotes ('channel name').
  • Element-wise calculation will be done when one of the operands is a channel or the parameter is a channel.
  • Decimal separators on literal numbers must be periods. Alternative separators such as commas are not supported.

Refer to the following table for examples of formula formats that you can use to configure a calculated channel.

Description Formula Format Example
Element-wise arithmetic addition 'channel name' + x 'AI7' + 1
'channel name x' + 'channel name y' 'AI7' + 'AI8'
Element-wise arithmetic subtraction 'channel name' - x 'AI7' - 1
'channel name x' - 'channel name y' 'AI7' - 'AI8'
Element-wise arithmetic multiplication 'channel name' * x 'AI7' * 5
'channel name x' * 'channel name y' 'AI7' * 'AI8'
Element-wise arithmetic division 'channel name' / x 'AI7' / 5
'channel name x' / 'channel name y' 'AI7' / 'AI8'
Apply the function to the channel element function('channel name') sin('AI7')
Arithmetic equation x + y * z / 'channel name' 2 + 3 * 4 / 'AI7'
Arithmetic equation (x + y) * z / 'channel name' (2 + 3) * 4 / 'AI7'
Number with scientific representation. 'channel name' + 1.23e-5 'AI8' + 1.23e-5
Constant usage function(constant * 'channel name')

sin(pi * 'AI7')

See supported functions, operators, and constants.

Unary minus -'channel name' -'AI7'
Unary plus (a no-op) +'channel name' +'AI7'
Power operator 'channel name'^x 'AI7'^3

Note: The data type for all numerics is double-precision, floating-point.

Refer to the following table for examples of formula elements that you can use to configure a calculated channel.

Formula Element Definition
Supported Functions sin Sine
cos Cosine
tan Tangent
arcsin Inverse of sine
arccos Inverse of cosine
arctan Inverse of tangent
abs Absolute value of any number
Supported Operators + Addition
- Subtraction
* Multiplication
/ Division
( ) Bracket; contents are evaluated first
^ Calculate the base raised to the power of the exponent
Supported Constants pi Pi (π) constant

Recently Viewed Topics