0% found this document useful (0 votes)
50 views23 pages

Infoplc Net Sitrain 07 Binary Operations

plc

Uploaded by

Camilo Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views23 pages

Infoplc Net Sitrain 07 Binary Operations

plc

Uploaded by

Camilo Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Binary Operations

F1

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.1

SITRAIN Training for


Automation and Industrial Solutions

Objectives
Upon completion of the chapter the participant will

SIMATIC S7
Siemens AG 2006. All rights reserved.

...

understand the difference between real connected NC contacts


and NO contacts, and programmed symbols

...

be able to explain the terms Result of Logic Operation (RLO),


Status (STAT) and First Check

...

be able to program basic binary logic operations

Date:
File:

2/4/2012
PRO1_07E.2

SITRAIN Training for


Automation and Industrial Solutions

Binary Logic Operations: AND, OR


LAD

Circuit Diagram

FBD

STL

S1 (I 0.0)
I 0.0

I 0.1

Q 8.0

&

I 0.1

S2 (I 0.1)

AND

I 0.0

Q 8.1
=

Q 8.1

L1
(Q 8.0)

A
A
=
=

I 0.0
I 0.1
Q 8.0
Q 8.1

O
O
=

I 0.2
I 0.3
Q 8.2

L2
(Q 8.1)

S3
(I 0.2)

I 0.2
S4
(I 0.3)

OR

Q 8.0
=

Q 8.2
I 0.2
I 0.3

I 0.3

>=1

Q 8.2
=

L3 (Q 8.2)

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.3

SITRAIN Training for


Automation and Industrial Solutions

Binary Logic Operations: Exclusive OR (XOR)

LAD

FBD

I 0.4
I 0.4

I 0.5

Q 8.0

I 0.4

I 0.5

&

I 0.5
I 0.4

>=1

I 0.5

I 0.5

Siemens AG 2006. All rights reserved.

Q 8.0
=

&

I 0.4

SIMATIC S7

STL

Date:
File:

2/4/2012
PRO1_07E.4

XOR

Q 8.0
=

A
AN
O
AN
A
=

I 0.4
I 0.5

X
X
=

I 0.4
I 0.5
Q8.0

I 0.4
I 0.5
Q8.0

SITRAIN Training for


Automation and Industrial Solutions

Sensors and Symbols


Process

The
sensor
is a ...

NO
contact

The sensor
is ...

Interpretation in the PLC Program

Voltage
present
at input?

Signal
state
at
input

activated

yes

Check
for signal state 1

Check
for signal state 0

Symbol /
Instruction

Result of
check

Symbol /
Instruction

LAD:

Yes
1

LAD:

NO contact

not
activated

no

0
FBD:

NC
contact

activated

not
activated

yes

A I x.y

SIMATIC S7
Siemens AG 2006. All rights reserved.

No
0

Date:
File:

2/4/2012
PRO1_07E.5

FBD:

Yes
1

&
No
0

STL:

No
0

NC contact

&
no

Result of
check

Yes
1

Yes
1

STL:

AN I x.y

No
0

SITRAIN Training for


Automation and Industrial Solutions

Exercise 1: Sensors and Symbols


Task: In all three examples, the light should be on when S1 is activated and S2 is not activated!
Hardware
S1

S2

E
1.0
I1.0

S1

EI1.1
1.1

EI1.0
1.0

Programmable controller

E 1.1
I1.1

Programmable controller

Q 4.0

I 1.1

I 1.0

Q 4.0

I 1.1

E I1.1
1.1

Programmable controller

Q 4.0

Light

Software

S2

EI1.0
1.0

Q 4.0

Light

I 1.0

S1

S2

Light

Q 4.0

I 1.0

I 1.1

Q 4.0

LAD

I 1.0

&

FBD

Q 4.0

I 1.1

STL

SIMATIC S7
Siemens AG 2006. All rights reserved.

&

I 1.0

Q 4.0

I 1.1

....... I 1.0
....... I 1.1
....... Q 4.0

....... I 1.0
....... I 1.1
....... Q 4.0

Date:
File:

I 1.0

2/4/2012
PRO1_07E.6

&
Q 4.0

I 1.1
....... I 1.0
....... I 1.1
....... Q 4.0

SITRAIN Training for


Automation and Industrial Solutions

Exercise 2: Add Conveyor Master Control Logic


Start

Stop
R

ON

CPU
Digital
Input
Module

Hard Wire Circuit

CPU
Digital
Output
Module

Start
I0.0
Stop

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.7

ON
I0.1 3

4
.
.

4
.
.

Q4.1

SITRAIN Training for


Automation and Industrial Solutions

Assignment, Setting, Resetting


LAD

I 1.0

I 1.1

FBD

Q 8.0

( )

Assignment

I 1.0

&

I 1.3

Q 8.1

(S )

Set

I 1.2

&

SIMATIC S7
Siemens AG 2006. All rights reserved.

A I 1.0
A I 1.1
= Q 8.0

A I 1.2
A I 1.3
S Q 8.1

Q 8.1

(R)
Reset

Q 8.1
S

I 1.3

I 1.4

Q 8.0
=

I 1.1

I 1.2

STL

I 1.5

I 1.4
I 1.5

Date:
File:

2/4/2012
PRO1_07E.8

>=1

Q 8.1
R

O I 1.4
O I 1.5
R Q 8.1

SITRAIN Training for


Automation and Industrial Solutions

Setting and Resetting a Flip Flop

LAD
M 5.7

I1.2

Dominant
Reset

FBD

SR

STL

M 5.7

Q 9.3
Q

I1.2

SR
Q9.3

I1.3

I1.3

M 5.7

I1.3

Dominant
Set

RS

M 5.7

Q 9.3
Q

I1.3

RS
Q9.3

I1.2
I1.2

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.9

A
S
A
R
A
=

I 1.2
M 5.7
I 1.3
M 5.7
M 5.7
Q 9.3

A
R
A
S
A
=

I 1.3
M 5.7
I 1.2
M 5.7
M 5.7
Q 9.3

SITRAIN Training for


Automation and Industrial Solutions

Midline Output Coil

LAD

I 1.0

I 1.1

STL

M 20.7

I 2.0

I 2.1

Q 4.0

( )

( )

FBD

I 1.0

A
A
=
A
A
A
=

I
I
M
M
I
I
Q

1.0
1.1
20.7
20.7
2.0
2.1
4.0

&
M 20.7

I 1.1

SIMATIC S7
Siemens AG 2006. All rights reserved.

&

I 2.0

Q 4.0

I 2.1

Date:
File:

2/4/2012
PRO1_07E.10

SITRAIN Training for


Automation and Industrial Solutions

Result of Logic Operation, First Check, and Examples

I 1.0

AN I 1.1

M 4.0

Q 8.0

Q 8.1

I 2.0

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.11

First Check

M 3.4

Result of Logic
Operation

:
:
=

Result of Check

Signal State

Example 3

First Check

Result of Logic
Operation

Result of Check

Signal State

Example 2

First Check

Result of Logic
Operation

Result of Check

Signal State

Example 1

SITRAIN Training for


Automation and Industrial Solutions

Instructions that Affect the RLO

LAD

NOT

I 0.0

FBD

Q 8.0

I0.1
NOT

( )

I 0.0

&

I 0.1

STL

Q 8.0
=

A I 0.0
A I 0.1
NOT
= Q 8.0

Examples:
STAT 0 Bit memory

CLR

not available

not available

CLR
= M 0.0

STAT 1 Bit memory

SET

SIMATIC S7
Siemens AG 2006. All rights reserved.

not available

not available

Date:
File:

2/4/2012
PRO1_07E.12

SET
= M 0.1

SITRAIN Training for


Automation and Industrial Solutions

Exercise 3: Programming the Operating Mode Section (FC 15)

DI

DO

I 0.0

T_System_ON

I 0.1

T_System_OFF

I 0.2
I 0.3

I 0.4

S_M/A_ModeSelect

I 0.5

T_M/A_Accept

L_SYSTEM

Q 4.1

T_Jog_RIGHT

L_MAN

T_Jog_LEFT

L_AUTO

Q 4.2
Q 4.3

-15V...+15V

AI2

AO1

-15V...+15V
AO2

AI1

AI1

AI2

0 8 1 5

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.13

AI1

AI2

AO1

AO2

SITRAIN Training for


Automation and Industrial Solutions

Exercise 3: "FC_Mode" (FC 15), Solution Hints


Network 1:

Indicator Light System ON

Q 4.1
SR

Network 2:

ON-Condition

OFF-Condition

Indicator Light MAN Mode

Q 4.2
SR

Network 3:

ON-Conditions

OFF-Conditions

Indicator Light AUTO Mode

Q 4.3
SR

SIMATIC S7
Siemens AG 2006. All rights reserved.

ON-Conditions

OFF-Conditions

Date:
File:

2/4/2012
PRO1_07E.14

SITRAIN Training for


Automation and Industrial Solutions

Exercise 4: Conveyor in AUTO Mode (Expanding FC 16)


Conv. Start

Transport Phase

Conv. Stop

Prox.Sens.Bay 1
I 8.5
Mom.Cont.Bay 1
I 8.1
Prox.Sens.Bay 2
I 8.6
Mom.Cont.Bay 2
I 8.2
Light Barrier
I 8.0
Run Conveyor
RIGHT
Q8.5

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.15

SITRAIN Training for


Automation and Industrial Solutions

Exercise 4: "FC_ConvMotor" (FC 16), Solution Hints


Network x

Jog RIGHT in MANUAL mode


Conditions for JOGGING
RIGHT
In MANUAL mode

Network y

M 16.2

Run Conveyor RIGHT in AUTO mode


M 16.4

Conditions for
Run Conveyor RIGHT
in AUTO mode

Network z

Memory bit for


Run Conveyor RIGHT
in AUTO mode

S
R

Control Run Conveyor RIGHT


M 16.2

>=1
Q 8.5

Siemens AG 2006. All rights reserved.

Run Conveyor RIGHT

M 16.4

SIMATIC S7

Memory bit for


Jog RIGHT
In MANUAL mode

Date:
File:

2/4/2012
PRO1_07E.16

SITRAIN Training for


Automation and Industrial Solutions

RLO Edge Detection


LAD
I 1.0

I 1.1

FBD

M1.0

M8.0

P
I 1.0

I 1.1

M1.1

I 1.0

&

STL

M1.0

M8.0

I 1.1

M8.1

I 1.0

&

M1.1

M8.1

I 1.1

A
A
FP
=

I 1.0
I 1.1
M1.0
M8.0

A
A
FN
=

I 1.0
I 1.1
M1.1
M8.1

I 1.0
I 1.1
& -RLO
M8.0
OB1 Cycle

OB1 Cycle

M8.1
OB1 Cycle

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

OB1 Cycle

2/4/2012
PRO1_07E.17

SITRAIN Training for


Automation and Industrial Solutions

Signal Edge Detection


LAD
I 1.0

I 1.1

POS
M_BIT

I 1.0

I 1.1

M1.1

M1.0

I 1.1
POS
M_BIT

M1.1

I 1.1
NEG
M_BIT

M8.0
Q

M1.0

NEG

FBD

M8.1
Q

M_BIT

I 1.0

I 1.0

STL
&
M8.0

=
I 1.0

&
M8.1

A
I 1.0
A
(
A
I 1.1
FP
M1.0
)
=
M8.0
A
I 1.0
A
(
A
I 1.1
FN
M1.1
)
=
M8.1

I 1.1
M8.0
OB1 Cycle

M8.1
OB1 Cycle

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.18

SITRAIN Training for


Automation and Industrial Solutions

Exercise 5: Integrating the Edge Detection in FC 16

Conv. Start

Transport Phase

Conv. Stop

Part at
Light barrier

Start condition
in AUTO mode

Light Barrier
(I 8.0)

Run Conveyor
RIGHT
(Q8.5)

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.19

SITRAIN Training for


Automation and Industrial Solutions

Exercise 6: Optimizing the Operating Mode Section (FC 15)


OLD: without edge detection
T_System_ON
(I 0.0)

T_System_OFF
(I 0.1, NC contact)
L_SYSTEM
(Q4.1)

NEW: with edge detection


T_System_ON
(I 0.0)

T_System_OFF
(I 0.1, NC contact)
L_SYSTEM
(Q 4.1)

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.20

SITRAIN Training for


Automation and Industrial Solutions

Unconditional Jump (Regardless of the RLO)

LAD

Network 1

FBD

NEW1

( JMP )
Network 2
:
:
:
:
Network x

NEW1
JMP

....

Network 1

JU NEW1

Network 2
:
:
:
:
Network x

Network 2
:
:
:
:
Network x

NEW1

NEW1

M5.5

Network 1

STL

I 4.7

M69.0

( )

SIMATIC S7
Siemens AG 2006. All rights reserved.

M5.5
I 4.7

Date:
File:

&

NEW1:
M69.0
=

2/4/2012
PRO1_07E.21

AN M5.5
AN I 4.7
=
M69.0

SITRAIN Training for


Automation and Industrial Solutions

Conditional Jump (Dependent on RLO)

LAD

Jump if
RLO=1

Jump if
RLO=0

I 0.0

I 0.2

SIMATIC S7
Siemens AG 2006. All rights reserved.

I 0.1

I 0.3

FBD

NEW1

I 0.0

(JMP)

I 0.1

I 0.2

NEW2

(JMPN)

Date:
File:

I 0.3

2/4/2012
PRO1_07E.22

&

&

STL

NEW1
JMP

A I 0.0
A I 0.1
JC NEW1

NEW2
JMPN

A I 0.2
A I 0.3
JCN NEW2

SITRAIN Training for


Automation and Industrial Solutions

Exercise 7: Putting Indicator Lights + Horn (FC 14) into Operation

"BAY1"
(I 8.5)

in MANUAL mode:
2Hz pulsed honking
while conveyor jogging

"BAY2"
(I 8.6)

"Horn"
(Q 8.7)

"L_Bay1"
(Q 8.1)

"L_Bay2"
(Q 8.2)

in AUTO mode:
- Constant light at both bays when a new part can be placed (both bays empty)
- 1Hz flashing light at the bay where the part is placed and the conveyor has not yet been started
- 2Hz flashing light at both bays during conveyor movement

SIMATIC S7
Siemens AG 2006. All rights reserved.

Date:
File:

2/4/2012
PRO1_07E.23

SITRAIN Training for


Automation and Industrial Solutions

You might also like