TapHome Icon

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

Syntax Highlighting Example

Reference

The script language reference is organized into the following pages:

  • Basics — association, multi-line algorithms, returned value, temporary variables, IF/ELSEIF/ELSE, SWITCH, loops, NaN, ISNULL, SLEEP, comments, numeric literals (hexadecimal and binary), and mathematical/logical expressions and operators.
  • Interpolation and thresholdsLINEAR (linear interpolation) and HYSTERESIS (threshold-based signal filtering).
  • Mathematical functionsMIN, MAX, AVG (and their STRICT variants), ROUND, ABS, DEWPOINT, POWER, MOD, CEIL, FLOOR, RAND, RANDINT, SIGN, SQRT, LOG, LN.
  • Bit operationsGETBIT, GETBITS, GETBYTE, SETBYTE, SETBIT, SETBITS, bit shifts, and bitwise AND/OR.
  • Text, String and Byte arrayLENGTH, BYTECOLLECTION, INDEXOF, COPY, REPLACE, SPLIT, COMPARE, APPEND, INSERT, REMOVEAT, GETAT, SETAT, ENCODE, DECODE, EQUALS.
  • SortingORDER, ORDERINDEX and their STRICT and descending variants.
  • Date and timeDATETIME, NOW, TIMESPAN, LOCALTIMEZONE, DATETIMEADD.
  • Data type conversionsTODOUBLE, TOSTRING, TOBCD, FROMBCD, TOBYTEARRAY, RGBTOHSV, HSVTORGB.
  • Parsing functionsPARSETEXT, PARSEJSON, PARSEXML.
  • Packet parserSENDHTTPREQUEST, SENDDATA, MQTTPUBLISH, FTPDOWNLOAD, FTPUPLOAD, COMPLETESERVICEATTRIBUTE, COMPLETESERVICEACTION, plus Modbus.