1
I am receiving a PLC variable, which is a Word(16).
However, I am not able to 'convert' this Word in 16 bits with their respective values (true or false).
1 Word = 16 bits.
I get word with 'full value''.
More details: This is a Webserver application. The files (html, css, ...) are stored inside the Siemens PLC (S7-1200 or S7-1500). Javascript Html pages will read some values from CLP.
Values obtained in tests:
bit8 256
bit9 512
bit10 1024
bit11 2048
bit12 4096
bit13 8192
bit14 16384
bit15 32768
bit0 1
bit1 2
bit2 4
bit3 8
bit4 16
bit5 32
bit6 64
bit7 128
When bit1 in the PLC is true, it returns the integer value 2 by the Word tag, and so on. When bit1 and bit2 are active, it adds up the values.