ljlhouben - 2023-04-20

Hi All

I'm having conversion issues with the REAL_TO_LINT function. I have a function that evaluates a 'ANY' pointer and adjusts the 'min' and 'max' values based on the connected variable. My function is working fine for all 'INT' type versions accept LINT. As my function is also capable of handling (L)REAL variables, the 'min' and 'max' are handled as REAL variables.

My issue is now for the LINT type and specific the 'max'. I calculate this value as EXPT(2,(<datalength> * 8) -1) -1
So 2^63 -1 in the case of the LINT. This calculation results in the expected REAL variable, however when converting this REAL_TO_LINT(), then I get the most negative number for the LINT type instead of the most positive number (as expected). So something goes wrong in this conversion. How to solve this?</datalength>