Limitation of decimal places

In many use cases it is sufficient in the app not to display all decimal places of floating-point numbers (PLC: REAL and LREAL). As an example, a temperature value is mentioned at this point, where a human being can still do something with a maximum of two digits after the decimal point.

At this point there are two possibilities to influence the number of decimal places displayed. In the first option, a setting is used for the entire app, and each variable is limited to a number of decimal places specified in the app settings (see App settings). The second possibility is to set a certain number of decimal places for a single variable via the PLC attributes (cf. Limitation of decimal places).

If different values for the number of decimal places are defined in the app settings and the setting on a single variable, the setting on the single variable is always taken into account first. It is therefore possible, for example, to define the value 2 for all floating-point numbers via the app settings and still deviate from this number for individual variables.

The restriction of decimal places means that the values are rounded. They are not cut off at all. The table below shows a simple example:

Value

Decimal Number Precision

Display in the app

1.68678

3

1.687

1.68678

1

1.7

1.68678

0

2

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.23 or higher

App version 1.2.6 or higher

TC3_IotCommunicator