|
A method for input binding that evaluates the specified condition expression and returns the target result value..
syntax
B.In(
Filter,
EnabledFilter
[,Cond1]
[,Value1]
[,Cond2]
[,Value2]
...
[,Default]
)
Parameters
Filter
|
|
Type:
|
character
|
|
Specify if you want to apply a format filter to the result value. The following two options are available:
N:[Number format] Example) N:@NUMBER
D:[Date and time format] Example: D:@DATETIME
|
EnabledFilter
|
|
Type:
|
Boolean
|
|
When defining multiple result values, you can use an array to specify whether or not to apply a format filter to each result value.
For example, if you enter c(T,F,T), the format filter will be applied to result value 1 and result value 3, but the format filter will not be applied to result value 2.
|
CondX
|
|
Type:
|
character
|
|
Specify the judgment conditions. There is no limit to the number of combinations of judgment conditions and result values.
|
ValueX
|
|
Type:
|
character
|
|
Specify the result value. There is no limit to the number of combinations of judgment conditions and result values.
|
Default
|
|
Type:
|
character
|
|
Specify the default value. It will be adopted when none of the criteria are met (optional).
|
Return Value
|
|
Type:
|
character
|
|
Returns the corresponding result value.
|
Explanation
This is a function for condition judgment only for bind. By passing a combination of the judgment condition and its result value as a parameter, it returns the result value that corresponds to the judgment condition.
There is no upper limit to the number of combinations of judgment conditions and result values, and they can be listed as follows: judgment condition 1, result value 1, judgment condition 2, result value 2, ..., default value (the value when none of the judgment conditions apply).
If you do not specify a judgment condition, you can specify a default value.
|
Example
Below is an example where the value of the tag "TAG01" is compared with a specified number and the color is changed.
B.In("", T, TAG01>100, "#FF0000",TAG01>50, "#FFFF00", "#0000FF")
|
Below, when TAGFAULT is True, it displays "ERROR" (a string), and otherwise displays TAG01 in numeric format.
By specifying the second parameter as c(F,T), the number formatting filter will be enabled only for result value 2.
B.In("N:@LOCALE", c(F,T), TAGFAULT, "ERROR", TAG01)
|
You can also specify the blink format for the result value with the B.BF function.
In this example, when TAG01 is True, it will flash red and green, and when False it will be solid red.
B.In("", T, TAG01, B.BF("@FAST","#FF0000","#00FF00"), "#FF0000")
|
This is an example where a default value is specified without specifying a judgment condition.
The following command will display the current time in the specified date format.
B.In("D:@DATETIME",T,$NOW)
|
|
Supported
reference
B.BF
|