Sie sind auf Seite 1von 39

Solutions for the Exercises

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Data:
Arquivo:

11/9/2007
S7-Bas-14.1

Contents
e

Pag

Chapter HW Configuration:
Adapting the ACTUAL Configuration ....................................................................................
Assign Parameters to CPU Clock Memory and Test ............................................................

3
5

Chapter Symbols:
Creating a Symbol Table for the Conveyor Model .................................................................

Chapter Block Architecture and Block Editor:


Jog Motor (FC 16) ..................................................................................................................
Calling FC 16 in OB 1 ............................................................................................................

10
11

Chapter Binary Operations:


Normally Open and Normally Closed Contacts ....................................................................
Mode Section of the Distribution Conveyor ............................................................................
Conveyor Movement in AUTO Mode ....................................................................................

12
13
14

Chapter Digital Operations:


Counting the Transported Parts (FC 18) ...............................................................................
Monitoring of the Transport Functions (FC 17) .....................................................................
Counting the Transported Parts (FC 18) ...............................................................................
Programming the Interlock in FC 16 (Conveyor - Operation) ...............................................

15
16
17
18

Chapter Data Storage in Data Blocks:


Counting the Transported Parts (Data Word in FC 18) .........................................................

19

SITRAIN Training for


Automation and Drives

Pgina 14-1

Programao Bsica em STEP 7


Solutions

Solutions for the Exercises

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Data:
Arquivo:

11/9/2007
S7-Bas-14.2

Contents
e

Pag

Chapter Functions and Function Blocks:


Using temporary Variables (FC 18) .......................................................................................
Editing a Parameter-assignable FC (FC 20) .........................................................................
Calling a Parameter-assignable FC (FC 20) (in FC 17) ........................................................
Editing a Parameter-assignable FB (FB 20) .........................................................................
Calling a Parameter-assignable FB (FB 20) (in FC 17) ........................................................
Recognizing Types of Variables ...........................................................................................

21
22
23
24
25
26

Chapter Troubleshooting:
Overview: Stop Errors and Logical Errors ............................................................................
Print out of the Error Program ..............................................................................................

27
28

Chapter Organization Blocks:


Determing type of Startup (OB 100) .....................................................................................

36

Chapter Analog Value Processing:


Recording and Displaying the Weight of the Transported Parts ...........................................

37

SITRAIN Training for


Automation and Drives

Pgina 14-2

Programao Bsica em STEP 7


Solutions

Adapting the Actual Configuration (16 Bit Unit)

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Note

SITRAIN Training for


Automation and Drives

Data:
Arquivo:

11/9/2007
S7-Bas-14.3

The result of the Exercise is displayed in the picture above (for the S7-300
16 bit training unit).

Pgina 14-3

Programao Bsica em STEP 7


Solutions

Adapting the Actual Configuration (32 Bit Unit)

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Note

SITRAIN Training for


Automation and Drives

Data:
Arquivo:

11/9/2007
S7-Bas-14.4

The result of the Exercise is displayed in the picture above (for the S7-300
32 bit training unit).

Pgina 14-4

Programao Bsica em STEP 7


Solutions

Assign Parameters to CPU Clock Memory and Test

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Note

SITRAIN Training for


Automation and Drives

Data:
Arquivo:

11/9/2007
S7-Bas-14.5

The result of the Exercise is displayed in the picture above.

Pgina 14-5

Programao Bsica em STEP 7


Solutions

Symbol Table (16 bit training unit)

SITRAIN Training for


Automation and Drives

Pgina 14-6

Programao Bsica em STEP 7


Solutions

Symbol Table (16 bit training unit)

SITRAIN Training for


Automation and Drives

Pgina 14-7

Programao Bsica em STEP 7


Solutions

Symbol Table (32 bit training unit)

SITRAIN Training for


Automation and Drives

Pgina 14-8

Programao Bsica em STEP 7


Solutions

Symbol Table (32 bit training unit)

SITRAIN Training for


Automation and Drives

Pgina 14-9

Programao Bsica em STEP 7


Solutions

Jog Motor (FC 16)

SITRAIN Training for


Automation and Drives

Pgina 14-10

Programao Bsica em STEP 7


Solutions

Calling FC 16 in OB 1

SITRAIN Training for


Automation and Drives

Pgina 14-11

Programao Bsica em STEP 7


Solutions

Normally Open and Normally Closed Contacts


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

S2

II1.0
1.0

I1.1
I 1.1

Programmable controller

S1
I1.0
I 1.0

Q 4.0

Light

Software
I 1.1

I1.1
I 1.1

Programmable controller

Q 4.0

Light

S2

I 1.0
I1.0

I1.1
I 1.1

Programmable controller

Q 4.0

I 1.0

S1

S2

Q 4.0

I 1.0

I 1.1

Light

Q 4.0

I 1.0

I 1.1

Q 4.0

LAD

&

I 1.0

FDB

Q 4.0

I 1.1

STL

A
AN
=

Siemens Engenharia e Service 2002. Todos os direitos reservados.

A
A
=

Data:
Arquivo:

I1.0
I1.1
Q 4.0

&

I 1.0
Q 4.0

I 1.1

I 1.0
I 1.1
Q 4.0

SIMATIC S7

&

I 1.0

Q 4.0

I 1.1
AN
A
=

I 1.0
I 1.1
Q 4.0

11/9/2007
S7-Bas-14.12

Exercise

Complete the programs above to obtain the following functionality: When


switch S1 is activated and switch S2 is not activated, the light should be ON in
all three cases.

Note !

The terms "NO contact" and "NC contact" have different meanings depending
on whether they are used in the process hardware context or as symbols in
the software.

SITRAIN Training for


Automation and Drives

Pgina 14-12

Programao Bsica em STEP 7


Solutions

Mode Section for the Distribution Conveyor

SITRAIN Training for


Automation and Drives

Pgina 14-13

Programao Bsica em STEP 7


Solutions

Conveyor Movement in AUTO Mode

SITRAIN Training for


Automation and Drives

Pgina 14-14

Programao Bsica em STEP 7


Solutions

Counting the Transported Parts (FC 18)

SITRAIN Training for


Automation and Drives

Pgina 14-15

Programao Bsica em STEP 7


Solutions

Monitoring of the Transport Functions (FC 17)

SITRAIN Training for


Automation and Drives

Pgina 14-16

Programao Bsica em STEP 7


Solutions

Counting the Transported Parts (FC 18)

SITRAIN Training for


Automation and Drives

Pgina 14-17

Programao Bsica em STEP 7


Solutions

Interlock in FC 16 (Conveyor - Operation)

SITRAIN Training for


Automation and Drives

Pgina 14-18

Programao Bsica em STEP 7


Solutions

Counting the Transported Parts (Data Word in FC 18)

SITRAIN Training for


Automation and Drives

Pgina 14-19

Programao Bsica em STEP 7


Solutions

Counting the Transported Parts (Data Word in FC 18)


Data Block "DB_Parts" (DB 18)

SITRAIN Training for


Automation and Drives

Pgina 14-20

Programao Bsica em STEP 7


Solutions

Using temporary Variables (FC 18)

SITRAIN Training for


Automation and Drives

Pgina 14-21

Programao Bsica em STEP 7


Solutions

Editing a Parameter-assignable FC (FC 20)

SITRAIN Training for


Automation and Drives

Pgina 14-22

Programao Bsica em STEP 7


Solutions

Calling a Parameter-assignable FC (FC 20) in FC 17

SITRAIN Training for


Automation and Drives

Pgina 14-23

Programao Bsica em STEP 7


Solutions

Editing a Parameter-assignable FB (FB 20)

SITRAIN Training for


Automation and Drives

Pgina 14-24

Programao Bsica em STEP 7


Solutions

Calling a Parameter-assignable FB (FB 20) in FC 17

SITRAIN Training for


Automation and Drives

Pgina 14-25

Programao Bsica em STEP 7


Solutions

Exercise: Recognizing Types of Variables

Statement
L
L
T
L
L
T
T

#Number_1
#Number_2
#Max_value
#Intermediate_result
Number_1"
MW 40
#Number_2

Global Local
X
X
X
X
X
X
X

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

Question

Absolute

Symbolic
X
X
X
X
X

Temporary

Static

Parameter
X
X

X
X

X
X

Data:
Arquivo:

11/9/2007
S7-Bas-14.26

What is not correct in the statement T#Number_2 ?


Number_2 is defined as an input parameter and thus read-only accesses are
possible

SITRAIN Training for


Automation and Drives

Pgina 14-26

Programao Bsica em STEP 7


Solutions

Overview: Stop Errors and Logical Errors


Stop Errors:
Error

Interrupt Point

Error Location

Incorrect -> Correct Instruction

FC 20, Network 1

FC 17, Network 2

CALL FC 20
Flash freq.: DBX 10.3

CALL FC 20
Flash freq.: M 10.3

FC 17, Network 3

FC 17, Network 3

CALL FB 20, DB 2
(Instance DB 2
not available)

Create and
Download
Instance DB 2

FC 18, Network 5

FC 18, Network 5

L DB 18.DBW 10
L #Setpoint
>=I

L DB 18.DBW 0
L #Setpoint
>=I

Logical Errors:
Error

Fault Function

Error Location

Incorrect -> Correct Instruction

Jog Conveyor to right


not possible

Evaluation Disturbance3:
FC 17, Network 4
no flash frequency

CALL FB 20, DB 3
Flash freq.:

Record and display act.


FC 18, Network 2
Numb.of parts not correct

:
L #Setpoint

SIMATIC S7
Siemens Engenharia e Service 2002. Todos os direitos reservados.

SITRAIN Training for


Automation and Drives

= "K_Conv_
RIGHT"

FC 16, Network 1

Data:
Arquivo:

= "M_Jog_
right
CALL FB 20,DB3
Flash freq.: M 10.3
:
L 1

11/9/2007
S7-Bas-14.27

Pgina 14-27

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

SITRAIN Training for


Automation and Drives

Pgina 14-28

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

SITRAIN Training for


Automation and Drives

Pgina 14-29

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

M_Jog_right

SITRAIN Training for


Automation and Drives

Pgina 14-30

Logical Error

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

Stop Error

M 10.3

SITRAIN Training for


Automation and Drives

Pgina 14-31

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

Not available

Stop Error

Logical Error
M 10.3

SITRAIN Training for


Automation and Drives

Pgina 14-32

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

Stop Error

"DB_Parts".
Act_quant

SITRAIN Training for


Automation and Drives

Logical Error

Pgina 14-33

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

SITRAIN Training for


Automation and Drives

Pgina 14-34

Programao Bsica em STEP 7


Solutions

Troubleshooting (Print-out with errors)

SITRAIN Training for


Automation and Drives

Pgina 14-35

Programao Bsica em STEP 7


Solutions

Determing type of Startup (OB 100)

SITRAIN Training for


Automation and Drives

Pgina 14-36

Programao Bsica em STEP 7


Solutions

Recording and Displaying the Weight of the Transported Parts


CPU-Properties: OB 35 Execution Interval

SITRAIN Training for


Automation and Drives

Pgina 14-37

Programao Bsica em STEP 7


Solutions

Recording and Displaying the Weight of the Transported Parts


Program in OB 35

SITRAIN Training for


Automation and Drives

Pgina 14-38

Programao Bsica em STEP 7


Solutions

Recording and Displaying the Weight of the Transported Parts


Expansion (Display Number of Parts) in FC 18

SITRAIN Training for


Automation and Drives

Pgina 14-39

Programao Bsica em STEP 7


Solutions

Das könnte Ihnen auch gefallen