Search
MENU
  • Expressions / Script language
  • Users and Permissions
  • Backup, restore, reset to factory settings
  • Expressions / Script language

    Multi-line scripting language with syntax highlighting, usable in smart rules Equation, Formula and Script, and also in Modbus and Packet parser interfaces.

    800

    Basics

    Association

    Mu := Se + 2;

    Multi-line algorithm

    Each line is divided by semicolon

    Last := Current;
    Current := 0;

    Returned value

    • Result of last line of code

    • RETURN(expression) stops execution of algorighm and returns content inside brackets

    (Co2 > 800) AND (Wind < 10);
    equals:
    RETURN((CO2 > 800) and (Wind < 10));

    Temporary variable

    Lives within the single execution of the script.

    VAR X := 5;

    IF clause

    Excel style

    IF(logical_expression, value_if_true, value_if_false);
    IF(logical_expression, value_if_true);

    Multi-line style

    IF X < 5
      RETURN(1);
    ELSEIF X > 10
      RETURN(3);
    ELSE
      RETURN(0);
    END

    Switch

    Tests an expression against a list of cases and returns the corresponding value of the first matching case, with a default value if nothing else is met.

    SWITCH(expression, case1, value1, [case2, ...], [value2, ...], default_value)

    Example:

    300
    SWITCH( MODBUSR(H, 168, UInt16),
      0, 0,
      0x0002, 1,
      0x0004, 2,
      0x0008, 3,
      0x0010, 4,
      0x0040, 5,
      0x0800, 6,
      NaN)

    Loop

    LOOP / WHILE ... repeats a series of commands based on a specified condition until that condition is met.
    CONTINUE ... skips the execution of commands and continues to the next cycle.
    BREAK ... terminates the loop.

    Example with condition at the beginning:

    int i := 10;
    while i > 0
        i := i - 1;
        
        if i > 5
            continue;
        else
            break;
        end
    loop

    Example with condition at the end:

    int i := 10;
    do
        i := i + i;
    loop while i < 10

    NaN (not a number) value

    NaN can be returned as a value in case real value is not known.

    IF Temperature > 250 
      RETURN(NaN);

    ISNAN(expression) function
    Returns TRUE if expression is not a number.

    ISNULL

    Returns true if the parameter is NULL, false otherwise. Used for String and Bytearray types. Example: if XML element is not found, returned value ISNULL.

    The syntax of the function is:

    ISNULL(object)

    Sleep

    Sleeps the script for number of miliseconds. Use only in very specific cases.

    SLEEP(5);

    Comments

    New line starting with character #

    # comment

    Numeric literals

    Hexadecimal numbers

    Expressions can also interpret hexadecimal numbers. Prefix 0x is required and the rest is not case sensitive.

    0x0A = 10

    0xA0A0   (41120)
    0xa0a0   (41120)

    Binary numbers

    0b1010 = 10

    0b10101010   (170)

    Mathematical expressions

    +, -, *, /

    (20.5 + 9.5) / 2    (15)

    Logical expressions

    AND, OR, !, =, !=, >, <

    (!IsRaining OR (Wind>30))
    MultiValueSwitchState != 2 (Not equal to 2)

    Functions

    LINEAR

    Returns linearly adjusted value – linear interpolation.

    LINEAR(input, value1_input, value1_output, value2_input, value2_output, [type])

    Parameters

    • input… input value
    • value1_input… value at the input at the lower limit
    • value1_output… value at the output at the lower limit
    • value2_input… value at the input at the upper limit
    • value2_output… value at the output at the upper limit
    • [type]… optional parameter. Defines what the result should be when the input value is out of range value1_input ↔︎ value2_input:
      • without parameter (same as with parameter BOUNDS)… If the input value is outside the defined range, the output value will be one of the extremes (minimum or maximum)
      • INFINITE… If the input value is outside the defined range, the result is an extrapolated value
      • STRICT… If the input value is outside the defined range, the output value will be NaN (not a number)

    Examples

    Example 1: LINEAR(250,  0,0,  50,500)   (Result is 25°C)
    
    Example 2: LINEAR(Co2,  400,0,  1200,1)
              (If value from Co2 sensor is 400ppm, output for air recovery will be 0%. 
               If Co2 is 1200, output will be 100%. And if e.g. Co2=800, output will be 50%)
    800

    Examples for different [type] attributes:

    • input = 11
    • value1_input = 0, value1_output = 400
    • value2_input = 10, value2_output = 2000
    • result for different [type] parameters:
      • BOUNDS (default value) = 2000
      • INFINITE = 2160
      • STRICT = NaN

    HYSTERESIS

    Hysteresis can be used to filter signals so that the output reacts less rapidly than it otherwise would by taking recent system history into account. For example, a thermostat controlling a heater may switch the heater on when the temperature drops below A, but not turn it off until the temperature rises above B.

    Returns 0 or 1.

    HYSTERESIS(value, upper_bound, lower_bound, upper_output, lower_output, last_value)

    Example: maintain a temperature of 20 °C within 2 ºC hysteresis range. Turn the heater on when the temperature drops to below 18 °C and off when the temperature exceeds 22 °C).

    heater := HYSTERESIS(temperature,   22, 18,   0, 1,   heater);

    Mathematical functions

    MIN

    MIN(value1, value2)

    Returns the smaller of the two values.

    MAX

    MAX(value1, value)

    Returns the larger of the two values.

    AVG

    The AVG function calculates average (mean) value of the provided numbers. The functions expects from 1 to 100 arguments.

    AVG( n1, n2, n3, …)

    Examples:

    AVG(40, 80)  		= 60
    AVG(2, 2, 6) 		= 3.3333
    AVG(80, NAN)		= 80
    AVG(NAN, NAN)		= NaN

    ROUND

    ROUND(value1)    

    Returns the rounded value.

    Example 1: ROUND(2.01)   (Result is 2)
    Example 2: ROUND(2.49)   (Result is 2)
    Example 3: ROUND(2.5)   (Result is 3)
    Example 4: ROUND(2.99)   (Result is 3)

    ABS

    The ABS function returns the absolute value (i.e. the modulus) of any supplied number.

    ABS(number)

    Examples:

    ABS(100)  ...   100
    ABS(-100)   ...   100

    DEWPOINT

    DEWPOINT(temperature, relativeHumidity)
    

    Returns the dew point temperature given the current temperature and relative humidity. Dew point is calculated according to this equation:http://bmcnoldy.rsmas.miami.edu/Humidity.html.

    Example 1: DEWPOINT(20, 0.50) (Result is ~9.26)
    Example 2: DEWPOINT(0, 1.00) (Result is 0)

    POWER

    The POWER function calculates a given number, raised to a supplied power.

    POWER(number, power)

    Examples:

    • POWER(2,3) … 2^3 = 8

    • POWER(10, -3) … 0,001

    • POWER(25, 0) … 1

    MOD

    The MOD function returns the remainder of a division between two supplied numbers.

    MOD(number, divisor)

    Arguments:

    • number - The number to be divided.

    • divisor - The value that the number argument is divided by.

    Examples:

    • MOD(6, 4)  … 2

    • MOD(6, 2.5) … 1

    CEIL

    The CEIL function rounds a supplied number away from zero, to the nearest multiple of a given number.

    CEIL(number, significance)

    Arguments:

    • number   - The number that is to be rounded.

    • significance (optional) - The multiple of significance that the supplied number should be rounded to. If the significance is not specified, then it is equal to 1.
      (This should generally have the same arithmetic sign (positive or negative) as the supplied number argument)

    Examples:

    • CEIL(22.25,0.1) … 22.3

    • CEIL(22.25,1) … 23

    • CEIL(22.25) … 23

    • CEIL(-22.25,-1) … -23

    • CEIL(-22.25,1) … -22

    • CEIL(-22.25) … -22

    • CEIL(-22.25,-5) … -25

    FLOOR

    The FLOOR function rounds a supplied number towards zero to the nearest multiple of a specified significance.

    FLOOR(number, significance)

    Arguments:

    • number - The number that is to be rounded.

    • significance (optional) -The multiple of significance that the supplied number is to be rounded to. If the significance is not specified, then it is equal to 1.
      (This should generally have the same arithmetic sign (positive or negative) as the supplied number argument)

    Examples:

    • FLOOR(22.25,0.1)… 22.2

    • FLOOR(22.25,1) … 22

    • FLOOR(22.25) … 22

    • FLOOR(-22.25,-1) … -22

    • FLOOR(-22.25,1) … -23

    • FLOOR(-22.25) … -23

    • FLOOR(-22.25,-5) … -20

    RAND

    The Rand function generates a random real number between 0 and 1.

    RAND()

    Examples:

    • RAND()

    RANDINT

    The RANDINT function generates a random integer between two supplied integers.

    RANDINT(bottom, top)

    Examples:

    • RANDINT(1,5)

    • RANDINT(-2,2)

    SIGN

    The SIGN function returns the arithmetic sign (+1, -1 or 0) of a supplied number. I.e. if the number is positive, the SIGN function returns +1, if the number is negative, the function returns -1 and if the number is 0 (zero), the function returns 0.

    SIGN(number)

    Examples:

    • SIGN(100) … 1

    • SIGN(0) … 0

    • SIGN(-100) … -1

    SQRT

    The SQRT function calculates the positive square root of a supplied number.

    SQRT(number)

    Examples:

    • SQRT(25) … 5

    LOG

    The LOG function calculates the logarithm of a given number, to a supplied base.

    LOG(number, base)

    Arguments:

    • number - The positive real number that you want to calculate the logarithm of.

    • base (optional) - An optional argument that specifies the base to which the logarithm should be calculated.
      If the argument is not specified, then the base argument uses the default value 10.

    Examples:

    • LOG(4,0.5) … -2

    • LOG(100) … 2

    LN

    The LN function calculates the natural logarithm of a given number.

    LN(number)

    where the number argument is the positive real number that you want to calculate the natural logarithm of.

    Examples:

    • LN(100) … 4,60517

    Bit operations

    GETBIT

    Returns a value of a bit in the specified position.

    GETBIT(number, bit_position)

    Arguments:

    • number - number to extract value of specific bit from

    • bit_position - position of bit, starting with 0, from right

    Examples:

    • GETBIT(2, 0) → first bit of number 2 (0b0010) is 0

    • GETBIT(4,2) → third bit of number 4 (0b0100) is 1

    GETBITS

    Returns value of specified number of bits in the specified position.

    GETBITS(number, start_bit, number_of_bits)

    Examples:

    • GETBITS(216, 3, 2) → number 216 = 0b1101 1000; value of 4th bit from the right is 1, 5th bit is 1, therefore result is 0b0011 = 3

    • GETBITS(0xFF, 0, 4) → number 0xFF = 255 = 0b1111 1111; value of first 4 bits from right is 0b1111 = 0xF = 15

    GETBYTE

    Returns a value of a byte in the specified number.

    GETBYTE( number, byte_position )

    Arguments:

    • number - number to extract value of specific byte from

    • byte_position - position of byte, starting from 0, from right

    Examples:

    GETBYTE(256, 0)  →  0001 0000 0000 →  0
    GETBYTE(256, 1)   →  0001 0000 0000  →  1
    GETBYTE(259, 0)   →  0001 0000 0011   →  3

    SETBYTE

    Assigns a new value to the specified byte in the provided number, and returns assigned value.

    SETBYTE( number, byte_position, new_value )

    Examples:

    SETBYTE(1, 0, 0)   →   0
    SETBYTE(256, 0, 255)   →   511
    SETBYTE(256, 1, 1)	  →   256
    SETBYTE(259, 1, 2)	  →    515

    SETBIT

    Assigns a new value to the specified bit in the provided number and returns a new number.

    SETBIT(number, bit_position, new_value)

    Arguments:

    • number - number to be modified

    • bit_position - position of bit, starting with 0, from right

    • new_value - 0 or 1 - value that is going to be set to specified bit

    Examples:

    • SETBIT(1, 1, 1) → 3

    • SETBIT(3, 1, 1) → 3

    • SETBIT(4, 2, 0) → 4

    • SETBIT(12, 1, 0) → 14

    SETBITS

    Assigns a new value to the specified bits in the provided number and returns a new number.

    SETBITS(number, start_bit, number_of_bits, new_value)

    Examples:

    • SETBITS(192, 4, 2, 3) → 240

    • SETBITS(192, 5, 2, 3) → 224

    <<   (LEFT BIT SHIFT)

    8 << 2   (32)

    Excel: BITLSHIFT(number, shift_amount)

    >> (RIGHT BIT SHIFT)

    32 >> 2   (8)

    Excel: BITRSHIFT(number, shift_amount)

    & (BITWISE AND)

    3 & 1   (1)

    Excel: BITAND(number1, number2)

    | (BITWISE OR)

    2 | 1 (3)

    Excel: BITOR(number1, number2)

    Text, String and Byte array

    LENGTH

    Returns length of an object or number of bytes. Object can be a number, boolean, string or Collection.

    LENGTH( object )

    Examples:

    LENGTH(“Hello World”)			(Result is 11)
    LENGTH(“40”)				(Result is 2)
    LENGTH(40)					(Result is 8)
    LENGTH(BYTECOLLECTION(“010203”)	(Result is 3)

    BYTECOLLECTION

    Creates a Collection<UInt8> from specified hexadecimal values

    BYTECOLLECTION( bytes )

    Examples:

    BYTECOLLECTION(“010203”) 				(Result is Collection<UInt8> {01, 02, 03})
    BYTECOLLECTION(“aa, be1-1,fe”) 			(Result is Collection<UInt8> {aa be 11 fe})

    INDEXOF

    Returns index of specified element in string or collection. Returns -1 if element cannot be found.

    INDEXOF( string/collection, element )

    Examples:

    INDEXOF("Hello", “H”)					(Result is 0)
    INDEXOF("Hello World", “Wor”)				(Result is 6)
    INDEXOF("Hello World", “Wor”)				(Result is 6)
    INDEXOF("Hello World", “or12”)				(Result is -1)
    INDEXOF(BYTECOLLECTION("ab cd ee ff 01 02"), 2)	(Result is 5)
    INDEXOF({1, 2, 3}, 3)						(Result is 2)

    COPY

    Copies specified string or collection (or part of them)

    COPY( string/collection, startIndex, length)

    Examples:

    COPY("Hello")					(Result is “Hello”)
    COPY("Hello World", 2)				(Result is “llo World”)
    COPY("Hello World", 2, 4)				(Result is “llo ”)
    COPY(BYTEARRAY("01020304")			(Result is byte array 01020304)
    COPY(BYTEARRAY("01020304", 2, 1)		(Result is byte array 03)

    REPLACE

    Returns a new string or collection, in which all occurrences of specified value are replaced with new value.

    REPLACE( string/collection, oldValue, newValue)

    Examples:

    REPLACE("Hello", “l”, “”)				(Result is “Heo”)
    REPLACE("Hello", “lo”, “22”)			(Result is “Hel22”)
    REPLACE(BYTECOLLECTION(“050607"), 5, 9)	(Result is Collection<UInt8>{09, 06, 07}

    SPLIT

    Splits string to substrings based on separator parameters.

    SPLIT( string, string )
    SPLIT( string, char )
    SPLIT( string, Collection<string> )
    SPLIT( string, Collection<char> )

    Examples:

    SPLIT("1;2;3;4", “;”)			(Result is Collection<String>{“1”, “2”, “3”, “4”})
    SPLIT("1;2;3.4", “2;”)		(Result is Collection<String>{“1;”, “3.4”})
    SPLIT("1;2;3.4", {“2”, “3.”)		(Result is Collection<String>{“1;”, “;”, “4”})

    COMPARE

    Compare 2 strings and returns an integer that indicates their relative position in the sort order.

    COMPARE( string, string, CompareOptions )

    Examples:

    COMPARE("abc", “abc”)						(Result is 0)
    COMPARE("abc", “ABC”)						(Result is 32)
    COMPARE("abc", “ABC”, CompareOptions.IgnoreCase)	(Result is 0)

    APPEND

    Append value to collection or string and returns new object with appended value.

    APPEND( string, string )
    APPEND( Collection, value )

    Examples:

    APPEND({1, 2}, 3)     (Result is Collection<Double>{1, 2, 3})
    APPEND("abc", “def”)  (Result is “abcdef”)

    INSERT

    Insert value to collection or string. Returns collection or string with inserted value.

    INSERT( collection, index, value )
    INSERT( string, index, value )

    Examples:

    INSERT(“Hello”, 5, “ World”)      (Result is “Hello World”)
    INSERT(“Hello”, 1, “i”)			  (Result is “Hiello”)
    INSERT({1, 2, 4}, 2, 3)			  (Result is Collection<Double>{1, 2, 3, 4})

    REMOVEAT

    Remove elements from collection or string based on element index and length. Returns collection or string without specified elements.

    REMOVEAT( collection, index, length )
    REMOVEAT( string, index, length )

    Examples:

    REMOVEAT(“Hello”, 1)			(Result is “Hllo”)
    REMOVEAT(“Hello”, 3, 2)			(Result is “Ho”)
    REMOVEAT({1, 2, 3, 4}, 2)			(Result is Collection<Double>{1, 2, 4})
    REMOVEAT({1, 2, 3, 4}, 2, 2)		(Result is Collection<Double>{1, 2})

    GETAT

    Get element value from collection or string based on provided index.

    GETAT( collection, index )
    GETAT( string, index )

    Examples:

    SETAT(“Hello”, 1, “a”)          (Result is “Hallo”)
    SETAT(“Hello”, 4, “o World”)    (Result is “Hello World”)
    SETAT({1, 2, 4}, 2, 3)          (Result is Collection<Double>{1, 2, 3})

    SETAT

    Set element value in collection or string at provided index.

    SETAT( collection, index, value )
    SETAT( string, index, value )

    Examples:

    INSERT(“Hello”, 5, “ World”)		(Result is “Hello World”)
    INSERT(“Hello”, 1, “i”)			(Result is “Hiello”)
    INSERT({1, 2, 4}, 2, 3)			(Result is Collection<Double>{1, 2, 3, 4})

    ENCODE

    Encodes specified string using on of the formats and returns the new string.

    ENCODE( string, format )

    Supported formats:

    • XML

    • Base64

    Examples:

    ENCODE("Hello", “xml”)				(Result is “Hello”)
    ENCODE("<Hello id=1>", “xml”)		(Result is “&lt;Hello id=1&gt;”)
    ENCODE("Hello", “base64”)			(Result is “SGVsbG8=”)

    DECODE

    Decodes specified string using one of the formats and returns the new string.

    DECODE( string, format )

    Supported formats:

    • XML

    • Base64

    Examples:

    DECODE("Hello", “xml”)				  (Result is “Hello”)
    DECODE("&lt;Hello id=1&gt;", “xml”)   (Result is “<Hello id=1>”)
    DECODE("SGVsbG8=", “base64”)		  (Result is “Hello”)

    EQUALS

    Compares two numbers with floating point. The numbers are considered to be equal if | n1 - n2 |< epsilon The default value of threshold (epsilon) is 0.005 and it is an optional parameter.

    EQUALS( number1, number2, epsilon=0.005 )

    Examples:

    EQUALS(1.33, 1.33)          1.0 (true)
    EQUALS(1.333, 1.3335)		1.0 (true)
    EQUALS(1.333, 1.338)		1.0 (false)
    EQUALS(1.333, 1.338, 0.01)	1.0 (true)
    EQUALS(NAN, NAN)		    1.0 (true)

    Date and time

    DATETIME

    Creates a DateTime object.

    DateTime.Ticks property is number of milliseconds from 1.1.0001 00:00:00.000.

    DateTime has properties: TICKS, YEAR, MONTH, DAY, DAYOFWEEK, DAYOFYEAR, HOUR, MINUTE, SECOND, MILLISECOND, KIND, UTCDATETIME, LOCALDATETIME, UNIXTIME

    DATETIME( ticks, DateTimeKind )
    DATETIME( string, format )
    DATETIME( string, DateTimeKind )
    DATETIME( year, month, day, hour, minute, second, millisecond, DateTimeKind  )

    Examples:

    VAR date:= DATETIME(2014, 12, 8, 23, 54, 12, 456);
    VAR date:= DATETIME(2014, 12, 8, 23, 54, 12, 456, DateTimeKind.Local);
    VAR date:= DATETIME(2014, 12, 8, 23, 54, 12, 456, DateTimeKind.Utc);
    VAR date:= DATETIME("13:36");
    VAR date:= DATETIME("2022-08-03T07:39:03.688133+05:00");
    VAR date:= DATETIME("03.01 2008 10:00"); 
    VAR date:= DATETIME("mar.01 2008 10:00");
    VAR date:= DATETIME("03.01 2008 10:00", "dd.MM yyyy hh:mm");
    VAR date:= DATETIME(518832000);
    VAR date:= DATETIME(518832000, DateTimeKind.Utc);
    VAR date := NOW(); date.YEAR := 1999;
    DATETIME date; date.UNIXTIME := 123456;

    NOW

    Returns DateTime object that is set to current date and time in local timezone.

    NOW()

    Examples:

    VAR now := NOW();

    LOCALTIMEZONE

    Returns local timezone as number of milliseconds from UTC time.

    LOCALTIMEZONE()

    Examples:

    VAR timezoneDiff := LOCALTIMEZONE();

    DATEADD

    Add specified number of years, months, days, hours, minutes, seconds, milliseconds to existing DateTime and return new DateTime.

    DATETIMEADD(datetime, years, months, days, hours, minutes, seconds, milliseconds)

    Examples:

    VAR dt := NOW(); VAR yearBefore := DATETIMEADD(dt, -1);

    Data type conversions

    TODOUBLE

    Converts string to number. Returns NaN on error.

    TODOUBLE( text )

    Examples:

    TODOUBLE(“232”) ... 232)
    TODOUBLE(“-192.332”)  ...  -192.332
    TODOUBLE(“some text”)  ...  NaN

    TOSTRING

    Returns a string value of the specified value or Collection according to the specified encoding. Encoding is optional (iso-8859-1 is used by default).

    TOSTRING(value, encoding)

    Examples:

    TOSTRING(192, “X”)  …  Result = “C0”
    TOSTRING(192, “X4”)  …  Result = “00C0”
    TOSTRING(192, “F4”)  …  Result = “123.3400”
    TOSTRING(192, “F0”)  …  Result = “123”
    TOSTRING(BYTECOLLECTION("48656c6c6f"))			(Result is “Hello”)
    TOSTRING(BYTECOLLECTION(\"48656c6c6f\"), “iso-8859-1”)	(Result is “Hello”)
    TOSTRING(192, “X4”)							(Result is “00C0”)

    TOBCD

    Converts the provided number to the binary-coded decimal (BCD) format. The scheme of encoding is BCD-8421.

    TOBCD(number)

    Examples:

    TOBCD(1)  ...  1
    TOBCD(9)  ...  9
    TOBCD(10)  ...  16

    FROMBCD

    Decodes the provided number, that is encoded in binary-coded decimal (BCD) format. The scheme of encoding is BCD-8421.

    FROMBCD(number)

    Examples:

    FROMBCD(16)  ...  10
    FROMBCD(32)  ...  20

    TOBYTEARRAY

    Converts string to byte array according to the specified encoding. Encoding is optional (iso-8859-1 is used by default).

    TOBYTEARRAY( string, encoding )

    Examples:

    TOBYTEARRAY("Hello")			(Result is byte array 48656c6c6f)

    RGBTOHSV

    Converts RGB color definition; returns color in Hue / Saturation / Brightness format.

    RGBTOHSV( r, g, b )      (r, g, b ... 0 - 0xFF)

    Example:

    VAR HSVColor := RGBTOHSV( r, g, b );
    VAR saturation := HSVColor.Saturation;   (Saturation ... 0 - 1)
    VAR hue := HSVColor.Hue;                 (Hue ... 0 - 360)
    VAR value := HSVColor.Value;             (Value ... 0 - 1)

    HSVTORGB

    Converts color defined by Hue / Saturation / Brightness; returns color in RGB format

    HSVTORGB( hue, saturation, value )

    Example:

    VAR color := HSVTORGB( hue, saturation, 1)
    VAR red := color.red;                   (red ... 0 - 0xFF)
    VAR green := color.green;               (green ... 0 - 0xFF)
    VAR blue := color.blue;                 (blue ... 0 - 0xFF)

    Parsing functions

    PARSETEXT

    Returns part of input text, based on left and right search patterns

    PARSETEXT( input, left_pattern, right_pattern)

    Examples:

    PARSETEXT(“Lorem ipsum dolor sit amet”, “ipsum”, “amet”) (Result is “dolor sit”)
    PARSETEXT(“<temp>12.2</temp>”, “<temp>”, “</temp”) (Result is 12.2)
    PARSETEXT(“<temp>12.2</temp>”, “<temp>”) (Result is 12.2)
    PARSETEXT(“status:ok,error:none”, “status:”) (Result is “ok”)
    PARSETEXT(“Lorem ipsum dolor sit amet”, “ipsum”) (Result is “dolor”)
    PARSETEXT(“Lorem ipsum dolor sit amet”, “ipsum…sit”) (Result is “amet”)
    PARSETEXT(“Lorem ipsum dolor sit amet consectetur adipiscing”, “ipsum…sit”, “adipiscing”) (Result is “amet consectetur”)

    PARSEJSON

    Returns value of element from json formatted string. Element is specified with json path.

    PARSEJSON( json_string, json_path, ignore_error)

    Examples:

    With json = { "firstName": "John",
      "lastName" : "doe",
      "age" : 26,
      "address"  : {
        "streetAddress": "naist street",
        "city"         : "Nara",
        "postalCode"   : "630-0192"
      }
    }
    
    PARSEJSON(json, “firstName”)			(Result is “John”)
    PARSEJSON(json, “address.city”)		(Result is “Nara”)
    PARSEJSON(json, “address.country”)		(error)
    PARSEJSON(json, “address.country”, 0)		(error)
    PARSEJSON(json, “address.city”, 1)		(Result is null)

    PARSEXML

    Returns value of element from xml string. Element is specified with xml path.

    PARSEXML( xml_string, xml_path)

    Examples:

    With xml= <?xml version="1.0"?>
    <catalog>
    	<book id="bk101">
    		<author>Gambardella, Matthew</author>
    		<title>XML Developer's Guide</title>
    		<genre>Computer</genre>
    		<price>44.95</price>
    		<publish_date>2000-10-01</publish_date>
    		<description>An in-depth look at creating...</description>
    	</book>
    	<book id="bk102">
    		<author>Ralls, Kim</author>
    		<title>Midnight Rain</title>
    		<genre>Fantasy</genre>
    		<price>5.95</price>
    		<publish_date>2000-12-16</publish_date>
    		<description>A former architect battles…</description>
    	</book>
    </catalog>
    
    PARSEXML(xml, “//catalog/book[1]/price”) (Result is 44.95)
    PARSEXML(xml, “//book[2]/title”) (Result is “Midnight Rain”)
    PARSEXML(xml, “//book[1]/@id”) (Result is “bk101”)
    PARSEXML(xml, “//catalog/magazine[1]/price”) (Result is null)

    If xml contains namespaces, you have to fully specify element names with namespace, eg. PARSEXML(xml, "//DIDL-Lite:container[dc:title='My Playlist’']/DIDL-Lite:res");

    Packet parser

    SENDHTTPREQUEST

    SENDDATA

    MQTTPUBLISH

    FTPDOWNLOAD

    FTPUPLOAD

    COMPLETESERVICEATTRIBUTE

    COMPLETESERVICEACTION

    Modbus

    Modbus

    Follow this link to find more information about Modbus configuration.