Analog tags that use floating-point values, How values are rounded – Rockwell Automation FactoryTalk View Machine Edition Users Guide User Manual

Page 98

Advertising
background image

F

ACTORY

T

ALK

V

IEW

M

ACHINE

E

DITION

U

SER

S

G

UIDE

7-2

• •

Analog tags that use floating-point values

You can assign analog tags to most of the connections in FactoryTalk View, including
both HMI and data server tags. If the analog tag uses a floating-point data type but an
integer value is required, the floating-point value is rounded.

For information about the data types available for analog tags, see Help.

How values are rounded

When a floating-point value must be rounded to an integer, this is how the value is
rounded:

If the number after the decimal is 4 or less, the value is rounded down. For example,
8.495 is rounded to 8.

If the number after the decimal is 6 or more, the value is rounded up. For example, 8.6
is rounded to 9.

If the number after the decimal is 5, the value is rounded using a “banker’s algorithm,”
to average out the rounding over time:

If the number before the decimal is 0, the value is rounded down. For example,
10.5 is rounded to 10.

If the number before the decimal is an odd number, the value is rounded up. For
example, 11.5 is rounded to 12.

If the number before the decimal is an even number, the value is rounded down.
For example, 12.5 is rounded to 12.

Floating point values are rounded to a maximum of six digits. Therefore, using a
floating-point data type and adding to it a value that exceeds the six significant
digits will result in a rounding error. For example, adding any number to 999,999
will result in a rounding error.

System

Information generated while the system is running, such as the name of the
logged-in user, system time and date, and so on.

FactoryTalk View creates system tags when you create an application. The
system tags are stored in the folder called “system” in the HMI tag
database. You cannot edit system tags. You can use system tags anywhere
you would use any other type of tag. For a list of system tags, see
Appendix C.

This tag type

Stores this type of data

Advertising