Use standard math operators, functions, and constants to customize existing hardware channels in the system.
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 |