S7 and HMI Programming
Create new project
Configure a device
Add new device
Controllers
Simatic S7-1200
CPU
CPU 1214C DC/DC/DC
(Last one)
(New window)
Program blocks
Main (OB1) (Double click)
Make, break, break, relay coil
Bus bar (Left vertical line)
Open branch
Make contact
Close branch
Bus bar
Open branch
Close branch
(Naming)
(Nertwork 2 starts)
Make contact
Empty box
Type “TON”
Relay coil
(Network 3 starts)
Empty box
Type “Mul”
Dint (datatype)
(Right click)
Define tag
Add new device
HMI
SIMATIC Basic Panel
4” display
KTP400 Basic
(First one double click)
Select PLC
(Browse)
PLC_1
Click “Finish”
Elements
Button
Basic Objects
Circle
Graphics
Wincc graphics folder
Equipment
Automation (EMF)
Motors
(Click on Motors)
I/O Field (Twice)
(Written using “Text”)
Properties (For Start)
Events
Press
Add function
Type set
Select “SetBitWhileKeyPressed”
First row right side three dot
Default Tag table double click
HMI start
Properties (For Stop)
Events
Press
Add function
Type set
Select “SetBitWhileKeyPressed”
First row right side three dot
Default Tag table double click
HMI stop
Properties (For Lamp)
Animations
Display
Appearance
Name right side three dot
Lamp
Range
0 Red
1 Green
Properties (For Green Motor)
Animations
Display
Visibility
Name right side three dot
Motor
Range
1
1
Enter
Properties (For Gray Motor)
Animations
Display
Visibility
Name right side three dot
Motor
Range
0
0
Enter
Properties (For I/O)
Properties
General
Name right side three dot
Present time sec
Mode: Input
Format pattern: 99
Enter
Properties (For another I/O)
Properties
General
Name right side three dot
Elapsed time
Mode: Output
Format pattern: 99999
Enter
Click Main [OB1]
Click “Download to device”
Pg/pc interface: PLCSIM
Connection to interface/subnet: PN/IE_1
Click “Start Search”
Load
Load
Right side three dot
Start module
Click “Finish”
Monitoring on/off (উপরে)
Go to “Root screen”
Click “Simulation”
Start simulation
Reading Analog signal
(In the above project)
(Network 4 starts)
Empty box
Go to “Root screen”
Take 3 “I/O”
Properties (For first I/O)
Properties
General
Name right side three dot
Tmp sensor input
Mode: Input
Format pattern: 99999
Enter
Properties (For second I/O)
Properties
General
Name right side three dot
Norm x output
Mode: Input/Output
Format pattern: 999
Enter
Properties (For third I/O)
Properties
General
Name right side three dot
Temperature
Mode: Output
Format pattern: 999
Enter
Go to Main [OB1]
Click “Start Simulation”
Start search
Load
Load
Right side three dot
Start module
Click “Finish”
Monitoring on/off (উপরে)
Go to “Root screen”
Click “Simulation”
Start simulation
Inputs:
27648
1
100 (Last two come automatically)