Official | HULFT IoT EdgeStreaming Reverse Reference First Edition: July 1, 2021
Change the control when certain conditions are met
This section describes the processing of changing the control when certain conditions are met from among the data acquired from the equipment.
This process outputs results such as the following:
- Example: when the condition is "if the input value is 30 or more, the output is 1"
-
-
If the input value is "31", the output is "1".
-
If the input value is "30", the output is "1".
-
If the input value is "29", nothing is output.
-
Description of the processing
The control is changed if the data acquired from the equipment meets the condition.
In the following example, if the condition of the numerical value of 30 or more is met, a control value of 1 is output.
Key features
- If Loop
-
This logic loops and outputs the items that match the conditions.
It can be set from Loop > Conditional loop > If Loop of the tool palette.
- Fraction processing
-
This logic rounds down the input numerical value and outputs the result.
It can be set from Number > Function > Fraction processing of the tool palette.
- Greater than or equal
-
This logic determines whether the upper input number (first handler) is greater than or equal to the lower input number (second handler).
It can be set from Condition > Number > Greater than or equal of the tool palette.
- Numeric constant (integer)
-
This logic outputs a numeric constant (integer).
It can be set from Number > Basic > Numeric constant (integer) of the tool palette.
Operation procedure
This section describes the settings of the conditions to output a control value of "30" or more.
1. Create a script.
For information about how to create a script, refer to First Step Guide.
The descriptions in this procedure are based on the following scripts:
2. On the script canvas, double-click mapping_1.
The Mapper editor is displayed.
3. Drag and drop the following logics from the tool palette onto the Mapper editor:
-
Number > Function > Fraction processing (to round down the input numerical value)
-
Number > Basic > Numeric constant (integer) (to specify the numerical value to determine the condition)
-
Condition > Number > Greater than or equal (to perform a determination)
-
Loop > Conditional loop > If Loop (to perform an extraction according to the conditions)
The logics are placed on the Mapper editor.
4. Enter the property of the placed logic.
-
Double-click the Numeric constant (integer) logic.
The Numeric constant (integer) Logic Property dialog box is displayed.
-
Enter "30" for Number (integer).
-
If necessary, also enter a comment in Comment and click Finish.
-
If necessary, double-click the Fraction processing logic, Greater than or equal logic, and If Loop logic, and then enter a comment in Comment and click Finish.
-
For the Fraction processing Logic Property dialog box
-
For the Greater than or equal Logic Property dialog box
-
For the If Loop Logic Property dialog box
-
5. Drag and drop the input numerical value onto the Fraction processing logic, the Fraction processing logic onto the Greater than or equal logic, and the Greater than or equal logic onto the output destination.
The mapping link from the input numerical value to the output destination via the Numeric constant (integer) logic and Greater than or equal logic is displayed.
6. Drag and drop the Numeric constant (integer) logic onto the Greater than or equal logic (second input handler).
The mapping link from the Numeric constant (integer) logic to the Greater than or equal logic (second input handler) is displayed.
7. Drag and drop the Greater than or equal logic onto the If Loop logic (second input handler).
The mapping link from the Greater than or equal logic to the If Loop logic (second input handler) is displayed.
8. Drag and drop the root element of the input source onto the If Loop logic (first input handler) and the If Loop logic onto the root element of the output destination.
The mapping link (dashed line) from the input source to the output destination via the If Loop logic is displayed.
9. Drag and drop Number > Basic > Numeric constant (integer) from the tool palette onto the Mapper editor to specify the control value.
The Numeric constant (integer) logic is placed in the Mapper editor.
10. Enter the property of the placed logic.
-
Double-click the Numeric constant (integer) logic.
The Numeric constant (integer) Logic Property dialog box is displayed.
-
Enter "1" for Number (integer).
-
If necessary, enter a comment in Comment and click Finish.
11. Drag and drop the Numeric constant (integer) logic onto the output destination node (or another logic).
The mapping link to the output destination from the Numeric constant (integer) logic is displayed.
12. Save the script.
For information about how to save a script, refer to First Step Guide.
Official | HULFT IoT EdgeStreaming Reverse Reference First Edition: July 1, 2021