XOR block

Short summary

Name

XOR

→POU type

→function

Category

IEC-block, Bitstring

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg no restrictions

Graphical interface

images/download/thumbnails/414780782/XOR-version-1-modificationdate-1534860816100-api-v2.png

Available since

  • version 1.0.0 (for logi.CAD 3) – initial variant

  • version 3.2.5 (for library Standard) – internal matters refactored in order to prevent warnings when compiling

Functionality

The block returns the result of a bitwise EXCLUSIVE-OR operation of all values connected to the inputs .

Inputs, return value


Identifier

→Data type

Description

Inputs:

IN1

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)

1st value

IN2

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)

2nd value

... (extensible until)

IN16

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)

16th value

Return value:

BOOL, BYTE, WORD, DWORD or LWORD(corresponds to →generic data type ANY_BIT)


Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

Example for usage within ST-editor

PROGRAM Test
VAR
result1, result2, result3, result4 : BOOL;
END_VAR
result1 := XOR(IN1 := FALSE, IN2 := FALSE); (* The variable 'result1' evaluates to 'FALSE'. *)
result2 := XOR(IN1 := FALSE, IN2 := TRUE ); (* The variable 'result2' evaluates to 'TRUE'. *)
result3 := XOR(IN1 := TRUE, IN2 := FALSE); (* The variable 'result3' evaluates to 'TRUE'. *)
result4 := XOR(IN1 := TRUE, IN2 := TRUE ); (* The variable 'result4' evaluates to 'FALSE'. *)
END_PROGRAM

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.