Bitwise Operations using Structured Text- IEC-61131-3

"AND", "OR", and "NOT" bitwise operation on every bit from the given numbers:

//structured Text Declaration

x:BYTE:=15;
y:BYTE:=20;
z:BYTE;

//Structured Text Bitwise Operation Example

z := x AND y;
z := x OR  y;
z := NOT y;

x and y were converted to binary, then every bit was bitwised using AND, OR and NOT

Result:

For reference below is the truth table for every operation: