Official | HULFT IoT EdgeStreaming Reverse Reference First Edition: July 1, 2021
Round off the acquired data after the decimal point
This section describes how to round off the numbers acquired from the equipment.
You can round the data to the nearest integer or to the specified valid decimal place (precision). This process outputs results such as the following:
- Example: for the Rounding logic
-
-
If the input value is "21.119", the output value is "21".
-
If the input value is "28.993", the output value is "29".
-
If the input value is "-13.348", the output value is "-13".
-
If the input value is "-31.752", the output value is "-32".
-
- Example: when the "precision" is "2" in the Rounding (precision) logic
-
-
If the input value is "21.119", the output value is "21.12".
-
If the input value is "28.993", the output value is "28.99".
-
If the input value is "-13.348", the output value is "-13.35".
-
If the input value is "-31.752", the output value is "-31.75".
-
Description of the processing
The data acquired from the equipment is rounded to the nearest integer or the specified precision, and then output.
Key features
- Rounding
-
This logic rounds the input numerical value and outputs an integer value.
It can be set from Number > Function > Rounding of the tool palette.
- Rounding (precision)
-
This logic rounds the input numerical value to the specified precision. For example, if Precision is "2", the third decimal place is rounded off and the value is output to the second decimal place.
It can be set from Number > Function > Rounding (precision) of the tool palette.
= Remarks =If the input value is smaller than the Precision specified in the Rounding (precision) logic, the number of valid decimal places is not increased during the output.
For example, if the Precision is "2" and the input value is "21.1", the output value remains "21.1".
Operation procedure
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 > Rounding (to round the input numerical value)
-
Number > Function > Rounding (precision) (to round the input numerical value to the specified precision)
The logics are placed on the Mapper editor.
4. Enter the property of the placed logic.
-
Double-click the Rounding or Rounding (precision) logic.
The Rounding Logic Property or Rounding (precision) Logic Property dialog box is displayed.
-
For the Rounding (precision) Logic Property dialog box, enter a value for Precision.
-
If necessary, enter a comment in Comment.
-
When rounding the input numerical value
-
When rounding the input numerical value to the specified precision
-
-
Click Finish.
5. Drag and drop the input source node (or another logic) onto the Rounding logic or the Rounding (precision) logic.
The mapping link to the Rounding logic or Rounding (precision) logic is displayed.
6. Drag and drop the Rounding logic or the Rounding (precision) logic onto the output destination node (or another logic).
The mapping link to the output destination from the Rounding logic or Rounding (precision) logic is displayed.
7. 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