-
Notifications
You must be signed in to change notification settings - Fork 74
ST Editor Tooltips #2412
Unanswered
franz-hoepfinger-4diac
asked this question in
Q&A
ST Editor Tooltips
#2412
i Guess i found an Error in ST Editor:
F_RAW_TO_PHYS := LINT_TO_REAL(UDINT_TO_LINT(u32Raw) + DINT_TO_LINT(stObj.i32Offset)) * stObj.r32Scale;
IF i write:
F_RAW_TO_PHYS := DINT_TO_REAL(UDINT_TO_DINT(u32Raw) + stObj.i32Offset) * stObj.r32Scale;
at the Stage:
UDINT_TO_DINT(u32Raw)
value can get negative.
so the Solution in the First line is the safe one, right ?
but ST Editor says "unneccessary Conversion" ..
if i accept both, i end with an Error:
F_RAW_TO_PHYS_LREAL := UDINT_TO_LREAL(u32Raw + stObj.i32Offset) * stObj.r32Scale;
Operator + is not applicable for types UDINT and DINT
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment