You are on page 1of 39

Solutions for the Exercises

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.1

Contents Page

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

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

Chapter Block Architecture and Block Editor:


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

Chapter Binary Operations:


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

Chapter Digital Operations:


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

Chapter Data Storage in Data Blocks:


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

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-1 Solutions
Solutions for the Exercises

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.2

Contents Page

Chapter Functions and Function Blocks:


Using temporary Variables (FC 18) ....................................................................................... 21
Editing a Parameter-assignable FC (FC 20) ......................................................................... 22
Calling a Parameter-assignable FC (FC 20) (in FC 17) ........................................................ 23
Editing a Parameter-assignable FB (FB 20) ......................................................................... 24
Calling a Parameter-assignable FB (FB 20) (in FC 17) ........................................................ 25
Recognizing Types of Variables ........................................................................................... 26

Chapter Troubleshooting:
Overview: Stop Errors and Logical Errors ............................................................................ 27
Print out of the Error Program .............................................................................................. 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 Programação Básica em STEP 7


Automation and Drives Página 14-2 Solutions
Adapting the Actual Configuration (16 Bit Unit)

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.3

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

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-3 Solutions
Adapting the Actual Configuration (32 Bit Unit)

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.4

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

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-4 Solutions
Assign Parameters to CPU Clock Memory and Test

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.5

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

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-5 Solutions
Symbol Table (16 bit training unit)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-6 Solutions
Symbol Table (16 bit training unit)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-7 Solutions
Symbol Table (32 bit training unit)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-8 Solutions
Symbol Table (32 bit training unit)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-9 Solutions
Jog Motor (FC 16)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-10 Solutions
Calling FC 16 in OB 1

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-11 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 S1 S2 S1 S2

II1.0
1.0 II1.1
1.1 II1.0
1.0 II1.1
1.1 I 1.0
I1.0 II1.1
1.1
Programmable controller Programmable controller Programmable controller
Q 4.0 Q 4.0 Q 4.0

Light Light Light

Software
I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0
LAD

I 1.0 & I 1.0 & I 1.0 &

FDB
I 1.1 Q 4.0 I 1.1 Q 4.0 I 1.1 Q 4.0

A I 1.0 A I1.0 AN I 1.0


STL AN I 1.1 A I1.1 A I 1.1
= Q 4.0 = Q 4.0 = Q 4.0

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: 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 Programação Básica em STEP 7


Automation and Drives Página 14-12 Solutions
Mode Section for the Distribution Conveyor

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-13 Solutions
Conveyor Movement in AUTO Mode

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-14 Solutions
Counting the Transported Parts (FC 18)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-15 Solutions
Monitoring of the Transport Functions (FC 17)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-16 Solutions
Counting the Transported Parts (FC 18)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-17 Solutions
Interlock in FC 16 (Conveyor - Operation)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-18 Solutions
Counting the Transported Parts (Data Word in FC 18)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-19 Solutions
Counting the Transported Parts (Data Word in FC 18)
Data Block "DB_Parts" (DB 18)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-20 Solutions
Using temporary Variables (FC 18)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-21 Solutions
Editing a Parameter-assignable FC (FC 20)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-22 Solutions
Calling a Parameter-assignable FC (FC 20) in FC 17

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-23 Solutions
Editing a Parameter-assignable FB (FB 20)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-24 Solutions
Calling a Parameter-assignable FB (FB 20) in FC 17

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-25 Solutions
Exercise: Recognizing Types of Variables

Statement
Global Local Absolute Symbolic Temporary Static Parameter
L #Number_1 X X X
L #Number_2 X X X
T #Max_value X X X
L #Intermediate_result X X X
L “Number_1" X X
T MW 40 X X
T #Number_2 X X X

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.26

Question 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 Programação Básica em STEP 7


Automation and Drives Página 14-26 Solutions
Overview: Stop Errors and Logical Errors
Stop Errors:
Error Interrupt Point Error Location Incorrect -> Correct Instruction

CALL FC 20 CALL FC 20
1 FC 20, Network 1 FC 17, Network 2
Flash freq.: DBX 10.3 Flash freq.: M 10.3
CALL FB 20, DB 2 Create and
2 FC 17, Network 3 FC 17, Network 3 (Instance DB 2 Download
not available) Instance DB 2
L DB 18.DBW 10 L DB 18.DBW 0
2 FC 18, Network 5 FC 18, Network 5 L #Setpoint L #Setpoint
>=I >=I

Logical Errors:
Error Fault Function Error Location Incorrect -> Correct Instruction

Jog Conveyor to right = "K_Conv_ = "M_Jog_


1 FC 16, Network 1
not possible RIGHT" right

Evaluation Disturbance3: CALL FB 20, DB 3 CALL FB 20,DB3


2 FC 17, Network 4
no flash frequency Flash freq.: Flash freq.: M 10.3

Record and display act. : :


3 FC 18, Network 2
Numb.of parts not correct L #Setpoint L 1

SIMATIC S7 Data: 13/11/2006


Siemens Engenharia e Service 2002. Todos os direitos reservados. Arquivo: S7-Bas-14.27

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-27 Solutions
Troubleshooting (Print-out with errors)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-28 Solutions
Troubleshooting (Print-out with errors)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-29 Solutions
Troubleshooting (Print-out with errors)

M_Jog_right Logical Error

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-30 Solutions
Troubleshooting (Print-out with errors)

Stop Error
M 10.3

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-31 Solutions
Troubleshooting (Print-out with errors)

Not available Stop Error

Logical Error
M 10.3

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-32 Solutions
Troubleshooting (Print-out with errors)

1 Logical Error

Stop Error
"DB_Parts".
Act_quant

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-33 Solutions
Troubleshooting (Print-out with errors)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-34 Solutions
Troubleshooting (Print-out with errors)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-35 Solutions
Determing type of Startup (OB 100)

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-36 Solutions
Recording and Displaying the Weight of the Transported Parts
CPU-Properties: OB 35 Execution Interval

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-37 Solutions
Recording and Displaying the Weight of the Transported Parts
Program in OB 35

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-38 Solutions
Recording and Displaying the Weight of the Transported Parts
Expansion (Display Number of Parts) in FC 18

SITRAIN Training for Programação Básica em STEP 7


Automation and Drives Página 14-39 Solutions

You might also like