Predefined functions and operators
The functions and operators available in the Expression Builder provide the ability to test and manipulate the values returned by the decorative elements.
TIP:
Mouse over or click a predefined function or operator to display a tooltip describing the input options for that function or operator. The tooltip will remain open until manually closed or the
Expression Builder
is closed.The Expression box displays the expression statement as it is created. Elements of the statement can be entered manually or by clicking items in the decorative elements tabs or the functions and operators area. This table describes the functions and operators in the
Expression Builder
.Name | Description |
|---|---|
Functions - Elements are inserted into these functions to replace the <value > token. | |
Format | Inserts: {Format(<value>,<style>,<valueDataType>)}. Returns the value entered in <value> using the numeric format entered in
<style>. Hexadecimal Byte Formatting styles:
Standard Microsoft® styles:
Data type options are:
|
Modulus | Inserts: {Modulus(<value1>,<value2>)}. Returns the remainder after the value of the decorative element inserted as <value1> is divided by the value of the decorative element inserted as <value2>. |
Round | Inserts: {Round(<value>)}. Returns the rounded value of the decorative element inserted as <value>. |
Abs | Inserts: {Abs(<value>)}. Returns the absolute value of the decorative element inserted as <value>. |
Int | Inserts {Int(value)}. Returns the integer portion of a number. |
Length | Inserts: {Length(<value>)}. Returns the number of characters of the decorative element inserted as <value>. |
GetParameterMax | Inserts:
{GetParameterMax({ObjectName},<subobjectType>,<parameter>)}. Applies to parameters that are included in a subobject. Returns the maximum value for the parameter inserted as <parameter> from within all subobjects that match the predefined parameter {SubObjectName} within the library object that matches {ObjectName}. |
CalcBitNumber | Inserts:
{CalcBitNumber({ObjectName},<subobjectType>,<parameter>,<subobjectIndex>,<resultDataType>,[startIndex],[endIndex])}. Applies to parameters that are included in a subobject. Returns the binary equivalent decimal value of a bit parameter across multiple subjects or within a certain range defined by the index values. |
CalcBitwiseValue | Inserts: {CalcBitwiseValue(<Tag Type>, <Mask Value>, <Bit
number>: {Expression})}. Returns the calculated value of Tags of type SINT, USINT, INT,UINT, DINT, UDINT,LINT and ULINT when the individual bits are parameterized. Each bit of the tag can have an individual expression applied to it. The instruction operates like an AND instruction on the mask and the parameterized value. |
SubObjectCount | Inserts: {SubObjectCount({ObjectName},<subobjectType>}. Returns the number of subobject instances for the subobject inserted as <subobjectType> within the library object that matches the predefined parameter {ObjectName}. |
GetParameter | Inserts: {GetParameter(<objectInstanceName>,parameterName,
defaultValue)}. Returns the parameter value of the specific object or the defaultValue if the function is unresolvable. |
GetSubParameter | Inserts: {GetSubParameter(<objectInstanceName>, <subobjectType>,
<subobjectIndexName>, <subobjectIndexValue>,parameterName,
defaultValue)}. Returns the parameter value of the specified object or the defaultValue if the function is unresolvable. |
InstanceCount | Inserts:{InstanceCount(<librarySolution>, <catalogNumber>,
<major>, <minor>)}. Counts and returns the number of instances for a specific library. |
Logical and Mathematical Operators | |
True | Logical TRUE: used to test the value returned by a decorative element. |
False | Logical FALSE: used to test the value returned by a decorative element. |
Or | Logical OR. |
And | Logical AND. |
Not | Logical NOT. |
= <> | Equal to and not equal to. |
( ) | Parentheses, used to set the order of operation for complex expressions. |
& | Mathematical AND. |
> >= <= < | Greater than, greater than or equal to, less than or equal to, and less than. |
+ - * / | Plus, minus, multiplied by, and divided by. |
Provide Feedback