Replies: 1 comment
-
I think there may be other ways to handle it, such as the following c code.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.When variables of different types are used in SEL functions, the accuracy of variables may be lost.
For example, when I enter a variable B of type DINT and another variable C of type REAL. The converted IR code first converts the variable B to type float. When I need the variable B, it convert the float variable B to DINT and then assign variable D. If the DINT value is outside the precision range of float, precision loss occur.
If I assign the variable B to 16777217, the variable D will get 16777216.
My ST code is as follows:
It will generate the ir code as follows:
Beta Was this translation helpful? Give feedback.
All reactions