AddExpression

<< Click to Display Table of Contents >>

Manual > Control Reference > Common to all controls > Common methods >

AddExpression


 

Register the formula.

 


syntax

AddExpression(

         name,

         expression

         [,ontimer = -1]

         [,offtimer = -1]

         )

 


Parameters

 

name

 

Type:

character

 

The expression name. Multiple expression names can be specified as an array.

 

expression

 

Type:

character

 

An expression. Multiple expressions can be specified as an array. Expressions are written in bind format.

Example: "U01.F01.T01"

Example: "U01.F01.T01+ U01.F01.T02"

Example: "U01.F01.T01 > 100"

 

ontimer

 

Type:

character

 

Wait time (ms) until the device is identified as On. Can be specified as an array.

-1 means no wait time is specified.

After changing from Off to On, if the time specified by ontimer has passed, OnExpressionValueChanged will occur. If it returns to Off before the time has passed, OnExpressionValueChanged will not occur (if -1 is specified for offtimer, OnExpressionValueChanged will occur if the time specified by ontimer has passed after the value changed).

 

offtimer

 

Type:

Number

 

Wait time (ms) until identifying Off. Can be specified as an array.

-1 means no wait time is specified.

After changing from On to Off, if the time specified by offtimer has passed, OnExpressionValueChanged will occur. If it returns to On before the time has passed, OnExpressionValueChanged will not occur.

 

Return Value

 

 

Type:

Boolean

 

FALSE - Failure. TRUE - Success.

 


hmtoggle_plus1Explanation

 

hmtoggle_plus1Example

 


Supported


Script Action

×

Browser script

×

Calculation Expression Syntax

 


reference