{"id":"iec-xor","model_id":"XOR","name":"CODESYS XOR","summary":"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.","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."],"safety_notes":[],"sources":[{"url":"https://infosys.beckhoff.com/content/1033/tc3_plc_intro/2528918411.html","title":"Beckhoff Information System","accessed":"2026-10-26"},{"url":"https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_operator_xor.html","title":"CODESYS Group","accessed":"2026-10-26"}],"verification":{"status":"source_checked","checked_at":"2026-10-26","values":2,"method":"llm_source_check"},"updated_at":"2026-10-26","type":"instruction","spec":{"language":"iec_61131_3","code":"XOR","group":"bitwise","parameters":[],"dialect":"CODESYS","related":[],"standards":[]},"url":"https://machineschema.com/instruction/iec-xor","license":"https://creativecommons.org/licenses/by/4.0/"}