Delta Electronics DVP15MC11T Operation Manual page 190

Table of Contents

Advertisement

The steps for XOR operation when more than 2 input parameters exist are:
The XOR result of In1 and In2 is got first; then the XOR operation of the previous result and In3 is
conducted and so on. Finally, the XOR operation of the previous XOR result and InN is processed.
The XOR result of In1 and In2 is Out_Temp and the XOR result of Out_Temp and In3 is Out as
shown below.
I n1
I n2
O ut _ Temp
I n3
O ut
In1~InN are allowed to be the variables of different data types when none of the data types of input
variables are BOOL.
When In1 to InN are the variables of different data types, take the data type which can include all
ranges of the values of In1~InN for the XOR operation.
For example, if the data type of In1 is BYTE and In2 is WORD, the data type of Out is WORD. In
operation, the value of In1 is converted from BYTE to WORD as shown in the following figure. (Bit8~
Bit 15 are supplemented and their values are all 0.) And then the logical XOR of the bit values of In1
and In2 is conducted as below.
In1_WORD
In2
O ut
If the data type of an input variable is BOOL, the data types of all input and output variables are
required to be BOOL. Otherwise, an error will occur in the compiling of the software.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if any
input variable is omitted. But the output variable is allowed to omit.
Programming Example
The data types of XOR_In1, XOR_In2 and Out1 are all BYTE. The values of XOR_In1 and XOR_In2
are 10 and 50 and the value of Out1 is 56 when XOR_EN is TRUE as shown in Variable 1.
The data types of XOR_In1, XOR_In2 and Out1 are BYTE, WORD and WORD. The values of
XOR_In1 and XOR_In2 are 255 and 256 and the value of Out1 is 511 when XOR_EN is TRUE as
shown in Variable 2.
B it 7
0
0
1
1
1
0
0
1
1
0
1
0
1
0
1
1
0
0
0
1
I n1
Bit15
0
0
0
0
0
0
0
0
0
1
1
0
1
0
0
0
1
1
0
1
0
Chapter 8 Logic Instructions
0
1
0
1
1
1
1
0
1
1
0
0
0
0
1
B it 7
0
0
1
1
0
1
Bit8
0
0
0
1
1
0
1
0
1
0
1
0
0
1
0
1
0
0
1
0
0
Bit0
0
0
0
0
0
Bit0
0
0
0
0
0
1
0
1
8-119
8_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents