F217_DXOR

Redundant instruction

NOTE

This is a redundant instruction. It is replaced by: XOR

The function performs a bit-wise exclusive OR operation on two 32-bit data items at inputs s1 and s2. The result of the instruction is returned at output d.

Using this instruction you can check how many bits in the two 32-bit data items are different, for example. At each position in which the bits at inputs s1 and s2 are different, a 1 is added in the result.

Parameters

Input

s1 (DWORD, DINT, UDINT, DATE, TOD, DT)

32-bit equivalent constant or 32-bit area

s2 (DWORD, DINT, UDINT, DATE, TOD, DT)

32-bit equivalent constant or 32-bit area

Output

d

32-bit area for storing XOR operation result

Remarks

The variables s1, s2 and d have to be of the same data type.

Truth table:

s1

s2

d

0

0

0

0

1

1

1

0

1

1

1

0

Error flags

sys_bIsEqual (turns to TRUE for one scan)

if the result calculated (output d) is 0.

Related topics:

Modified on: 2019-01-24Feedback on this pagePanasonic hotline