Vous êtes sur la page 1sur 23

AND: AND logic operation

The "AND logic operation" instruction is used to combine the


value at the IN1 input and the value at the IN2 input bit-by-bit by AND
logic and query the result at the OUT output.
When Executed, bit 0 of the value at the IN1 input and bit 0
of the value at the IN2 input are logically ANDed. The result is stored in
bit 0 of output OUT. The same logic operation is executed for all other
bits of the specified values
To add the AND instruction
Instructions Basic instructions Word logic operations AND
Double click the instruction or drag and drop the instruction into the network
Select the data type (ex: WORD)
Data type selected as Word
Add a New Data Block and Open it
Create Elements for Parameters of AND in the Data Block
Click Add New, Then give any name (IN1) and select data type (WORD).
Data type for IN1 is Selected
Create Elements for other parameters in AND' with respect to parameter datatype
Select and Copy the Element from Data Block.
Paste it to the Respective parameter.
Likewise Copy and paste the other Element from Data Block to AND parameter.
Add a New Watch table and Open it
Copy the Elements in Data Block
Then Paste the Elements to the Watch table.
Download the Program and Go online.
Modify the values of IN0 and IN1 inputs
If operand Tag_1" has the signal state "1, the "AND logic operation" instruction is
executed.
The value of operand IN1" and the value of operand IN2" are ANDed. The result is
mapped bit-for-bit and output in operand.
ANDed Bits in OUT operand can be seen in Watch table
Open Watch table and Click Monitor all to view the online value
Change the Display format to Binary (BIN).
Change the Display format to Binary (BIN) in all Elements.
Expand the Name column.
Logically ANDed Bits in OUT operand can be seen in Monitor value column.

Vous aimerez peut-être aussi