Under certain circumstances, it may be necessary to use a simple script during the object configuration. For example, you may enter a condition and a command expression to the touch object as shown below. The conditional and command expressions follow the format of script programming.
...
(1) Condition Expression
Operator | Function | Example | Description |
&& | Logical AND | A && B | If A and B are true, the result is 1. In other cases, the result is 0. |
|| | Logical OR | A || B | If A and B are false, the result is 0. In other cases, the result is 1. |
< | Less than | A < B | If A is smaller than B, the result is 1. In other cases, the result is 0. |
> | Greater than | A > B | If A is greater than B, the result is 1. In other cases, the result is 0. |
<= or =< | Less than or equal to | A <= B | If A is smaller than or equal to B, the result is 1. In other cases, the result is 0. |
>= or => | Greater than or equal to | A >= B | If A is greater than or equal to B, the result is 1. In other cases, the result is 0. |
== | Equal to | A == B | If A is equal to B, the result is 1. In other cases, the result is 0. |
!= | Is not equal to | A != B | If A is not B, the result is 1. In other cases, the result is 0. |
...
Example | Description |
(Tag_A != 1) && (Tab_B == 10) | If the value of Tag_A is not 1 and the value of Tag_B is 10, the result is 1. In other cases, it returns 0. |
Sin(Tag_A) == 1 | If the sine of Tag_A is 1, the result is 1. In other cases, it returns 0. |
Tag_A < 100 | If Tag_A is smaller than 100, the result is 1. In other cases, it returns 0. |
(Tag_A + Tag_B) < (Tag_A + Tag_C) | If the sum of Tag_A and Tag_B is smaller than the sum of Tag_A and Tag_C, then the result is 1. In other cases, it returns 0. |
(2) Command Expression
In Xpanel, multiple command expressions can be used. The command expression is a special script program. You can also use the functions in the script for command expression.
...