Skip to content

Navigation Menu

Sign in
Sign up

ST Editor Tooltips #2412

Unanswered
franz-hoepfinger-4diac asked this question in Q&A
Discussion options

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

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /