JeremyM
Lifetime Supporting Member
Oh for the love of god, that explains alot.
Since i havent used CCW i looked quickly at the Codesys help for reference of the AND operator and they support bitwise operation on WORD data type.
Maybe try this instead pasbra:
Code:FOR i := 0 TO 15 DO Input[i] := (ANY_TO_DINT(INT_InputLogix) AND SHL(1, i)) > 0; END_FOR; or FOR i := 0 TO 15 DO Input[i] := FALSE; IF (ANY_TO_DINT(INT_InputLogix) AND SHL(1, i)) > 0 THEN Input[i] := TRUE; END_IF; END_FOR;
That operator ought to be overloaded... everywhere. It's nearly 2022 FFS.
To any platform that requires a separate instruction or user-made code: GFY.