cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

64bit integer value is not shown correctly

64bit integer value is not shown correctly

NoRisk4Project
Long-established Member

Hello,

when I try to show 64bit integer PLC values like “LINT” (correlates  "Int64" for OPC UA) or “ULINT” and  “LWORD” (correlates "UInt64" for OPC UA),  the value is not shown correctly.

The last 4 digits seems to be rounded when I try to use values near the type defined maximum for these data types.

The LINT PLC value “-9223372036854775808” is shown as “-9223372036854776000”.

The ULINT and LWORD PLC value “18446744073709551615” is shown as “18446744073709552000”.

When I enter the value "-9223372036854775808" into the input field for the LINT value, the correct value "-9223372036854775808" is written into the PLC, but the HMI shows “-9223372036854776000".

2024-03-22_11h24_23.png

32bit and 16bit Integer values are shown correct, even I reach the maximum value for these data types.  

1 REPLY 1

webiq-sk
Frequent Contributor

JavaScript has its own limits which affect all web HMI systems:

Number.MAX_SAFE_INTEGER is 9007199254740991
"The term "safe" refers to the fact that any number greater than the one mentioned above cannot be assumed to be accurately and appropriately represented. This restriction is imposed by the doubleprecision 64-bit number format used by Javascript"
https://www.tutorialspoint.com/what-is-javascript-s-highest-integer-value-that-a-number-can-go-to-wi...

Please also see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INT...https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number.max_safe_integer

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist