Expression Reference
  • 02 Feb 2024
  • PDF

Expression Reference

  • PDF

Article summary

Input Value

The current value for tags is returned using the IV function. The function can return values from the input tag by calling IV or from any other tag by calling IV(tagname).

Math Functions

Math functionality beyond the four basic operators needs to be referenced using the Math Library (Class) (note: link is to external website).

The syntax is: Math. (note the period on the end) and then the desired function name and arguments. For example, the syntax for squaring the input tag’s values would be: Math.Pow(IV,2).

Or, to take the square root of the input tag’s values: Math.Sqrt(IV).

Additional VB.NET Math Library Functions (search online for more information):

Abs: Returns the absolute value of a Decimal number.

Acos: Returns the angle whose cosine is the specified number.

Asin: Returns the angle whose sine is the specified number.

Atan: Returns the angle whose tangent is the specified number.

Atan2: Returns the angle whose tangent is the quotient of two specified numbers.

BigMul: Produces the full product of two 32-bit numbers.

Ceiling: Returns the smallest integral value that is greater than or equal to the specified decimal number.

Cos: Returns the cosine of the specified angle.

Cosh: Returns the hyperbolic cosine of the specified angle.

Exp: Returns e raised to the specified power.

Floor: Returns the largest integer less than or equal to the specified decimal number.

Log: Returns the natural (base e) logarithm of a specified number.

Log10: Returns the base 10 logarithm of a specified number.

Max: Returns the larger of two 8-bit unsigned integers.

Min: Returns the smaller of two 8-bit unsigned integers.

Pow: Returns a specified number raised to the specified power.

Round: Rounds a decimal value to the nearest integral value.

Sign: Returns a value indicating the sign of a decimal number.

Sin: Returns the sine of the specified angle.

Sinh: Returns the hyperbolic sine of the specified angle.

Sqrt: Returns the square root of a specified number.

Tan: Returns the tangent of the specified angle.

Tanh: Returns the hyperbolic tangent of the specified angle.

Truncate: Calculates the integral part of a specified decimal number.

If a certain function is desired but the exact name isn’t known, typing Math. into the editor window should open an Intellisense menu with a list of options (if not try hitting ctrl + space bar). Intellisense will attempt to complete the function. Use the scroll bar to look through more options. When an option is highlighted, a description of the function’s purpose and syntax will appear.


Was this article helpful?