You are on page 1of 39

Solutions for the Exercises

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.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, C18) ..................................................................... 15
Monitoring of the Transport Functions (FC 17) ..................................................................... 16
Counting the Transported Parts (FC 18, MW20) ................................................................. 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 ST-7PRO1


Automation and Drives Page 1 Solutions
Solutions for the Exercises

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.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 ST-7PRO1


Automation and Drives Page 2 Solutions
Adapting the ACTUAL Configuration

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.3

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

SITRAIN Training for ST-7PRO1


Automation and Drives Page 3 Solutions
Adapting the ACTUAL Configuration

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.4

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

SITRAIN Training for ST-7PRO1


Automation and Drives Page 4 Solutions
Assign Parameters to CPU Clock Memory and Test

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.5

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

SITRAIN Training for ST-7PRO1


Automation and Drives Page 5 Solutions
Symbol Table for the 16 bit Training Unit (Part 1)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 6 Solutions
Symbol Table for the 16 bit Training Unit (Part 2)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 7 Solutions
Symbol Table for the 32 bit Training Unit (Part 1)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 8 Solutions
Symbol Table for the 32 bit Training Unit (Part 2)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 9 Solutions
Jog Motor (FC 16)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 10 Solutions
Calling FC 16 in OB 1

SITRAIN Training for ST-7PRO1


Automation and Drives Page 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 II1.0
1.0 I 1.1
I1.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 I 1.0 AN I 1.0


STL AN I 1.1 A I 1.1 A I 1.1
= Q 4.0 = Q 4.0 = Q 4.0

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.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 ST-7PRO1


Automation and Drives Page 12 Solutions
Mode Section of the Distribution Conveyor

SITRAIN Training for ST-7PRO1


Automation and Drives Page 13 Solutions
Conveyor Movement in AUTO Mode

SITRAIN Training for ST-7PRO1


Automation and Drives Page 14 Solutions
Counting the Transported Parts (FC 18, C 18)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 15 Solutions
Monitoring the Transport Functions (FC 17)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 16 Solutions
Counting the Transported Parts (FC 18, MW 20)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 17 Solutions
Programming the Interlock in FC 16 (Conveyor Operation)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 18 Solutions
Counting the Transported Parts (Data Word in FC 18)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 19 Solutions
Counting the Transported Parts (Data Word in FC 18),
Data Block “DB_Parts” (DB 18)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 20 Solutions
Using temporary Variables (FC 18)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 21 Solutions
Editing a Parameter-assignable FC (FC 20)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 22 Solutions
Calling a Parameter-assignable FC (FC 20) (in FC 17)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 23 Solutions
Editing a Parameter-assignable FB (FB 20)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 24 Solutions
Calling a Parameter-assignable FB (FB 20) (in FC 17)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 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 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.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 ST-7PRO1


Automation and Drives Page 26 Solutions
Overview: Stop Errors and Logical Errors
Stop Errors:
Error Interrupt Point Error Location Incorrect -> Correct Instruction

1 FC 18, Network 4 FC 18, Network 4 L PIW400 L „IW_BCD“

L DB18.DBW10 L DBW18.DBW0
2 FC 18, Network 5 FC 18, Network 5 L #Setpoint L #Setpoint
>=I >=I
CALL FC20 CALL FC20
2 FC 20, Network 1 FC 17, Network 2 Flash Frequency Flash Frequency
= DBX10.3 = „2_Hz“ (M10.3)

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

Jog Conveyor to right


1 FC 16, Network 1 = "K_RT“ = "M_Jog_Right“
not possible

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


2 FC 17, Network 4
no flash frequency Flash freq.: Flash freq.: „2_Hz“

Record and display act. : :


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

SIMATIC S7 Date: 12.03.03


SITRAIN Training for
Automation and Drives
Siemens AG 2002. All rights reserved. File: PRO1_16E.27

SITRAIN Training for ST-7PRO1


Automation and Drives Page 27 Solutions
Print out of the Error Program

SITRAIN Training for ST-7PRO1


Automation and Drives Page 28 Solutions
Print out of the Error Program

SITRAIN Training for ST-7PRO1


Automation and Drives Page 29 Solutions
Print out of the Error Program

„M_Jog_Right“

Logical Error

SITRAIN Training for ST-7PRO1


Automation and Drives Page 30 Solutions
Print out of the Error Program

„2_Hz“ (M 10.3) STOP Error

SITRAIN Training for ST-7PRO1


Automation and Drives Page 31 Solutions
Print out of the Error Program

Logical Error
„2_Hz“

SITRAIN Training for ST-7PRO1


Automation and Drives Page 32 Solutions
Print out of the Error Program

1 Logical Error

STOP Error

„IW_BCD“

STOP Error

„DB_Parts“.ACT_Number_of_Parts

SITRAIN Training for ST-7PRO1


Automation and Drives Page 33 Solutions
Print out of the Error Program

SITRAIN Training for ST-7PRO1


Automation and Drives Page 34 Solutions
Print out of the Error Program

SITRAIN Training for ST-7PRO1


Automation and Drives Page 35 Solutions
Determing type of Startup (OB 100)

SITRAIN Training for ST-7PRO1


Automation and Drives Page 36 Solutions
Recording and Displaying the Weight of the Transported Parts
CPU Properties: Cyclic Interrupt OB 35

SITRAIN Training for ST-7PRO1


Automation and Drives Page 37 Solutions
Recording and Displaying the Weight of the Transported Parts
Program in OB 35

SITRAIN Training for ST-7PRO1


Automation and Drives Page 38 Solutions
Recording and Displaying the Weight of the Transported Parts
Display Number of Parts in FC 18

SITRAIN Training for ST-7PRO1


Automation and Drives Page 39 Solutions

You might also like