Creating a Program for an Assembly Line
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.1
Functional Description of the Assembly Line
Final assembly stations with Preassembly
‘occupied‘ indicator and INI 1 to INI 3 LB1
acknowledgement button (Proximity switches) Light barrier
M1 H 1, H 2, H 3, H4 S 1, S 2, S 3, S 4
(Motor) (LEDs) (Acknowledgement buttons)
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.2
Program Structure
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.3
Configuration of the S7-300 Training Area
Version A
(16 channel
I/O modules)
Module --> PS CPU DI 16 DI 16 DO 16 DO 16 DI 16 DO 16 AI/AO4
Slot No. --> 1 2 4 5 6 7 8 9 10
I/O Address --> 0 4 8 12 16 20 352
Version B
(32 channel
I/O modules)
Module --> PS CPU DI 32 DO 32 DI8/DO8 AI 2
Slot No. --> 1 2 4 5 6 7
I/O Address --> 0 4 8 304
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.4
The Assembly Line
INI 1 to INI 3 LB1
(Proximity switches) Light barrier
M1 H 1, H 2, H 3, H4 S 1, S 2, S 3, S 4
(Motor) (LEDs) (Acknowledgement buttons)
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.5
Exercise: Creating a Project
Enter project
name here
and confirm
with "OK"
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.6
Exercise: Reading Out the Actual Configuration and Adapting It
Step What to Do Result
1 Start the SIMATIC Manager The tool is started
2 Open the project "My_Project" The project structure is displayed
3 Load the actual configuration using A new HW station is created
PLC -> Upload Station
4 Rename the station you inserted to
"My_Station"
Check whether the correct
5 ???
modules (order number) are entered
6 Enter the correct order numbers The CPU‘s parameter blocks
for the modules are displayed
Select the following parameters: The CPU and the analog module are
7 - CPU: flash. freq. MB 10, MPI networked assigned parameters
- Analog mod.: diagn. inter. channel 0/1
8 Save, compile and
load the configuration
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.7
Exercise: Importing a Symbol Table
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.8
Exercise: Checking the Sensors and Actuators of the Assembly Line
32 channel training unit
16 channel training unit
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.9
Procedure for Creating a Program
Define task
Docu-
menta-
Determine hardware tion
Define program structure
(Structogram)
Create program (LAD,FBD, STL)
Debug
Program test
Debug
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.10
Selection of the Appropriate CPU
1. Rough estimate using the following formula:
Number of instructions = (I+O)x logic nesting depth
2. Using the electronic catalog CA 01 to help make selections
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.11
Structogram for Program Creation
Define task
Define program structure
Parameter-assignable block?
Yes No
Define block parameters ./.
Create program
Errors exist?
Yes No
Debug ./.
Program test
Errors exist?
Yes No
Debug
./.
Repeat as long as there are errors
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.12
Elements of the Structogram (1)
Function Symbol
Structure block
SB
(Sequence)
SB 1
Series of SB 2
Sequences :
SB 3
Condition
Real Y N
Alternation
SB y SB n
Condition
Conditional Y N
Alternation
SB y ./.
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.13
Elements of the Structogram (2)
Function Symbol
1
2
Variable V= . . .
Multiple
3
branch,
Case n
SB 1 SB 2 SB 3 SB n
Start/End-
Condition SB
controlled
loop Condition
SB
SB 1
Jump out
of the loop Condition
SB 2
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.14
Structogram for the Operating Mode Section
yes I 0.0 = "1"
no
System On, Set output ./.
Q8.1(Q4.1)
yes I 0.1 = "0"
no
System On, Reset ./.
output Q8.1 (Q4.1)
Q8.1 (Q4.1)="1" and
I 0.4="0" and I 0.5="1"
yes no
Manual mode, Set output ./.
Q8.2 (Q4.2)
Q8.1 (Q4.1)="0" or
I 0.4="1" and I 0.5="1"
yes no
Manual mode, Reset ./.
output Q8.2 (Q4.2)
Q8.1 (Q4.1)="1" and
I 0.4="1" and I 0.5="1"
yes no
Automatic mode, Set ./.
output Q8.3 (Q4.3)
Q8.1 (Q4.1)="0" or
I 0.4="0" and I 0.5="1"
yes no
Automatic mode, Reset ./.
Q8.3(Q4.3)
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.15
Exercise: Programming the Assembly Line (Mode Selection)
System ON/OFF: Manual/Automatic mode:
I 0.0 = Start (Mom.-cont. swith with NO function) I 0.4 = Manual /Automatic (Switch)
I 0.1 = Stop (Mom.-cont. switch with NC function) I 0.5 = Adopt operating mode
(Mom.-cont. switch with NO
function)
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.16
Exercise: Create a Structogram for the Conveyor Movement
yes
no
./.
yes
no
./.
yes
no
./.
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.17
Exercise: Programming the Assembly Line (Conveyor Movement)
Manual/Automatic mode:
I 0.0 = Start (Mom.-cont. switch with NO function) I 0.4 = Manual /Automatic (Switch)
I 0.1 = Stop (Mom.-cont. switch with NC function) I 0.5 = Adopt operating mode (Mom.-cont.
switch with NO function)
I 0.2 = Jog foreward (M.-c. sw. with NO)
I 0.3 = Jog back (M.-c. sw. with NC func.)
Q20.5 (Q8.5) Conveyor belt forward <-- Q20.4 (Q8.4) LED H 4
Q20.6 (Q8.6) Conveyor belt back -->
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.18
Exercise: Programming the Assembly Line (Automatic Mode)
Manual /Automatic mode:
I 0.0 = Start (Mom.-cont. switch with NO function) I 0.4 = Manual /Automatic (Switch)
I 0.1 = Stop (Mom.-cont. switch with NC function) I 0.5 = Adopt operating mode (Mom.-cont.
switch with NO function)
I 0.2 = Jog foreward (M.-c. sw. with NO f.)
I 0.3 = Jog back (M.-c. sw. with NC func.)
I 16.5 to I 16.7 (I 8.5 to I 8.7) Proximity switches INI 1to INI 3 I 16.0 (I 8.0) Light barrier
Q20.7 (Q8.7) Horn
Q20.1 to Q20.3 (Q8.1 to Q8.3) LEDs H1 to H 3
I 16.1 to I 16.3 (I 8.1 to I 8.3) Acknowledgement switches S 1 to S 3
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.19
Exercise: Programming the Assembly Line (Statistic)
Quantity Bay 1 MW 100
Quantity Bay 2 MW 102
Quantity Bay 3 MW 104
Total quantity MW 106
% of prod. capacity Bay 1 MW 110
% of prod. capacity Bay 2 MW 112
% of prod. capacity Bay 3 MW 114
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.20
Exercise: Programming the Assembly Line (Display)
BCD coded BCD coded
pushwheel button digital display
0 00 2 0 0 0 3
0 00 0 Display EEEE
0 00 1 Display Parts Bay 1
0 00 2 Display Parts Bay 2
0 00 3 Display Parts Bay 3
0 00 4 Display Total Parts
0 00 5 Display EEEE
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.21
Exercise: Programming the Assembly Line (Startup)
OB 100
Network 1: RLO „0“
bit memory
Network 2: RLO „1“
bit memory
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.22
Additional Exercise: Programming the Assembly Line (Saving Data)
Save data every day at 16:10 (4:10 p.m.)
DB 10
Quantity Bay 1
Quantity Bay 2
Quantity Bay 3
Total quantity
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.23
Additional Exercise: Programming the Assembly Line
(Checking the Weight)
SIMATIC S7 Date: 18.08.2018 SITRAIN Training for
Automation and Drives
Siemens AG 2000. All rights reserved. File: PRSERV_01E.24