hello to everyone I have a doubt that I wanted to clarify about a exdesc that I found on a tag:

Event = sourcetag, IF Not BadVal ('sourcetag') THEN (IF

and in particular on the parties: IF ('sourcetag' AND 1080) = 1024 IF ('sourcetag' AND 1080) = 64 IF ('sourcetag' AND 1080) = 0

I wondered the meaning of the "AND 1080" and accordingly, the meaning of the number after the "=" sign

Thank you all for the availability, greetings

Event = sourcetag, IF Not BadVal ('sourcetag') THEN (IF

**(****'sourcetag' AND 1080) = 1024**THEN 1 ELSE (IF ('sourcetag' AND 1080) = 0 THEN 0 ELSE (IF ('sourcetag' AND 1080) 2 = 64 THEN ELSE "Bad Input"))) ELSE "Bad Input"and in particular on the parties: IF ('sourcetag' AND 1080) = 1024 IF ('sourcetag' AND 1080) = 64 IF ('sourcetag' AND 1080) = 0

I wondered the meaning of the "AND 1080" and accordingly, the meaning of the number after the "=" sign

Thank you all for the availability, greetings

Hello Marco,

('sourcetag' AND 1080) means that a bitmask (identified by 1080) is used with a logical AND against the sourcetag's current value.

Assuming 16 byte resolution (INT16) the bitwise / dual representation of 1080 would be 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0. Please see the following tables for a few examples.

I hope that I didn't make any mistake when dealing with 1's and 0's. CPU's do this a lot better than human brains.

One interesting thing is the result will never be 64 because with 1080 the bit representing 64 is not set. Also 2 will never become equal to 64. Did you possibly break the equation when pasting it?