GX Works3 - Function block for rounding float numbers with variable amount of significant numbers

GX Works3 - Function block for rounding float numbers with variable amount of significant numbers

This article contains GX Works3 function block for rounding float numbers with variable amount of significant numbers.

"Copyright © Mitsubishi Electric Europe B.V.

IMPORTANT !

These Function Blocks are demo versions that are only  intended to demonstrate program functions and provide general orientation for  your software choices. They are not suitable for use in real applications! "

 "Improper use of demo versions in applications can lead to serious malfunctions  and damage! Programs for real applications must always be configured for the  individual application by trained staff and tested thoroughly before being  used.

 Mitsubishi Electric cannot assume any liability if these examples are used in real applications."


This function block return rounded FLOAT number, rounded with mathematical convention of rounding numbers. Selecting amount of significant numbers is possible using second input.

Input/Output

Data Type

Description

i_eNumber

FLOAT

Number to be rounded

i_iSignificantNum

Word [Signed]

Amount of significant numbers

EROUND

FLOAT

Rounded number


 

Selecting amount of numbers after the dot is possible using i_iSignificantNum input. When „0” is inputted, number will be rounded to integer part:

6.3864 -> 6.0000

When i_iSignificantNum is set to another number, for example „2”:

6.3864 -> 6.3900



    • Related Articles

    • GX Works3 - iQ-F - Function for converting LREAL to REAL numbers

      This article contains GX Works3 function for iQ-F CPU that converts LREAL numbers to REAL numbers. This function converts a value from LREAL data type to REAL data type on iQ-F CPU. Input/Output Data Type Description LREAL_IN Word [Signed](0..3) ...
    • iQ-F PWM outputs controler for PID temperature regulation

      This article describes the function block to control heating/cooling outputs with PWM for temperature control using PID Ten artykuł opisuje blok funkcyjny do sterowania wyjściami grzania/chłodzenia wykorzystując PWM dla kontroli temperatury poprzez ...
    • iQ-F PID controller function block

      This article describes implementation of a PID instruction inside a function block for iQ-F PLC. Ten artykuł opisuje blok funkcyjny dla sterownika iQ-F implementujący instrukcję PID. "Copyright © Mitsubishi Electric Europe B.V. IMPORTANT ! These ...
    • iQ-F - Conversion between single STRING and array of WORD values

      This article contains GX Works3 function blocks for iQ-F CPU that that allow division of a single string into an array of WORD values and joining an array of WORD values into a single string. Function blocks These function blocks can be used to ...
    • Summary of the programs included in iQ Works suite

      This article summarizes all the software included in the Mitsubishi iQ Works software suite. An iQ Works license code is required for all programs to work. Link to the software presented in the ...