CODESYS XOR

XOR is an IEC operator that performs a bitwise exclusive OR on bit operands. For two input bits, the output is 1 only when exactly one input is 1; if both inputs are 1 or both are 0, the output is 0. The operator is permitted for BOOL, BYTE, WORD, DWORD and LWORD data types.

Source checked2/2 values · 2026-10-26

Specification

2 sources
Languageiec 61131 3
CodeXOR
Groupbitwise
DialectCODESYS

Study notes

  • Permitted data types: BOOL, BYTE, WORD, DWORD, LWORD.
  • For an XOR POU with more than two inputs, the inputs are compared in pairs and then the corresponding results.
  • Example: 2#1001_0011 XOR 2#1000_1010 gives var1 = 2#0001_1001.
↑↓ navigate↵ openesc close