Tập lệnh Bit Logic PLC S7 300

1                     Bit Logic Instructions

1.1                          Overview of Bit Logic Instructions

Description

Bit logic instructions work with two digits, 1 and 0. These two digits form the base of a number system called the binary system. The two digits 1 and 0 are called binary digits or bits. In conjunction with AND, OR, XOR and outputs, a 1 stands for logical YES and a 0 for logical NO.

The bit logic instructions interpret signal states of 1 and 0 and combine them according to Boolean logic. These combinations produce a result of 1 or 0 that is called the ”result of logic operation” (RLO).

There are bit logic instructions to perform the following functions:

·       AND, OR and Exclusive OR: these instructions check the signal state and produce a result that is either copied to the RLO bit or combined with it.

·       AND-before-OR Logic Operation and OR-before-AND Logic Operation

·       Assign and Midline Output. These instructions assign the RLO or store it temporarily.

 

The following instructions react to an RLO of 1:                          

·       S : Set Output

·       R : Reset Output

·       SR : Set_Reset Flip Flop

·       RS : Reset_Set Flip Flop

 

Other instructions react to a positive or negative edge transition to perform the following functions:

·       N : Negative RLO Edge Detection

·       P : Positive RLO Edge Detection

·       NEG : Address Negative Edge Detection

·       POS : Address Positive Edge Detection

 

The remaining instructions affect the RLO directly in the following ways:

·       Insert Binary Input

·       Negate Binary Input

·       SAVE : Save RLO to BR Memory

 

 

 

 

 

                                                                                                                                                                                                                           

 

 

 

 

 

 

 

 

 

 


1.2 >=1 : OR Logic Operation


Symbol

 

 

 

 

 

>=1

 
<address>

 

<address>


 

Parameter

Data Type

Memory Area

Description

<address>

BOOL

I, Q, M, T, C, D, L

The address indicates the bit whose signal state will be checked.

 

Description

With the OR instruction, you can check the signal states of two or more specified addresses at the inputs of an OR box.

If the signal state of one of the addresses is 1, the condition is satisfied and the instruction produces the result 1. If the signal state of all addresses is 0, the condition is not satisfied and the instruction produces the result 0.

If the OR instruction is the first instruction in a string of logic operations, it saves the result of its signal state check in the RLO bit.

Each OR instruction that is not the first instruction in the string of logic operations combines the result of its signal state check with the value stored in the RLO bit. These values are combined according to the OR truth table.

 

 

Status Word

 

 

 

BR

CC1

CC0

OV

OS

OR

STA

RLO

FC

writes

-

-

-

-

-

X

X

X

1

 

 

 

Example

 

 


>=1

 
I 0.0

 

I 0.1


Q 4.0



 

=

 
Output Q4.0 is set when the signal state is 1 at input I0.0 OR at input I0.1.

 

 

 


 

OR truth table                                                         


Results of the logic operation

The following table shows the results that arise from the OR logic operation of two operands:

 

 

Signal state of the first operand

Signal state of the second operand

Result of the logic operation

1

0

1

0

1

1

1

1

1

0

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

                                                                                                                                                                                        

 

 

 

 

 

 

 

 

Ngày:19/02/2020 Chia sẻ bởi:

CÓ THỂ BẠN QUAN TÂM