Basic Training SIEMENS
Basic Training SIEMENS
Micro-automation
SIMATIC S7-1200
SIMATIC S7-1200
2. Signal board or
Communication
board
3. Signal Module
for I/O expansion
(up to 8 : depended on model)
4. Communication 1. Main unit
(10 DIO, 14 DIO, 24 DIO
Unrestricted © Siemens AG 2017 Module (up to 3) depended on model)
Slide 33 SLT / DF FA
SIMATIC S7-1200
14 DI, 10 DQ, 2 AI
CPU1215C, CPU1217C
2 AQ
CPU1215C, CPU1217C
2 Ethernet ports
CPU1215C CPU1217C
Unrestricted © Siemens AG 2017
Slide 34 SLT / DF FA
SIMATIC S7-1200 : Local station
S7-1200 :
S7-1200 : CPU1212C
CPU1211C
6 DI, 4 DQ, 2 AI 8 DI, 6 DQ, 2 AI
3 : HSC 4 : HSC
Board
Board
3 CM 3 CM Board 2 SM
14 DI, 10 DQ, 2 AI
S7-1200 : CPU1214C, CPU1215C, CPU1217C
6 : HSC
CPU1215C, CPU1217C
2 AQ
CPU1215C, CPU1217C
2 Ethernet ports
SIMATIC S7-1200
IO Controller
PROFINET
Type of DI
Use PTO to
select DC
Type of DO
Unrestricted © Siemens AG 2017
Slide 37 SLT / DF FA
S7-1200 : Board
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 42 SLT / DF FA
1. Introduction to SIMATIC Step 7
1 System requirements
2 Software Environment
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 54 SLT / DF FA
2. Programming Procedure
2. Hardware Configuration
5. Compile Project
6. Download to PLC
7. Monitoring On/Off
Portal view
From Portal view, there are 3 methods to switch to Project view:
a. In "First steps" choose "open the project view"
b. Choose "Project view" in the corner
c. Click the combination " Alt + F7 " on the keyboard
Project view
c Press Alt + F7
b
Click OK
Hardware catalog
6
Hide
Up to 3 Communication Modules
Unrestricted © Siemens AG 2017
Slide 63 SLT / DF FA
2.2 Hardware Configuration : Upload from the unit
1 4
2
6
3 5
7 7
9
Unrestricted © Siemens AG 2017
Slide 64 SLT / DF FA
2.2 Hardware Configuration : Upload from the unit
11
12
13
10
Check to flash LED
14
Unrestricted © Siemens AG 2017
Slide 65 SLT / DF FA
2.2 Hardware Configuration : Setting IP address and Subnet mask
Double click to
open Device view
1
Click CPU
2
3
Specify the IP address and Subnet mask that you
- System memory bits are bits working as a system constant, such as M1.2 is always ON and M1.3 is always OFF
- Clock memory bits are output as a clock signal with various frequencies
10 Hz 100 ms
5 Hz 200 ms
2.5 Hz 400 ms
2 Hz 500 ms
1.25 Hz 800 ms
1 Hz 1 Sec
0.625 Hz 1.6 Sec
0.5 Hz 2 Sec
Unrestricted © Siemens AG 2017 Ref : Page 113, S7-1200 Programmable controller, System Manual, V4.2, 09/2016, A5E02486680-AK
Slide 68 SLT / DF FA
2.3 Declaring PLC Tags
Blank block
Open branch
Unrestricted © Siemens AG 2017
Slide 72 Close branch SLT / DF FA
Sample 1 : Self interlocking
Right-click at CPU
Click Download
Choose interface type
6
Click Load
Unrestricted © Siemens AG 2017
Slide 76 SLT / DF FA
2.6 Download to PLC
Click Load 8
Click Finish
10
Unrestricted © Siemens AG 2017
Slide 77 SLT / DF FA
2.7 Monitoring Online
3. When you create a project there are some files created. So when you want to use your
project with another device, you should copy completely all the project folder not just the
.ap file
Unrestricted © Siemens AG 2017 In case you are using TIA Portal V13, the file name extension will be .ap13
Slide 79 SLT / DF FA
A-1 Archiving and Retrieving Project
1. Click Project - Archive : Archive is to compress you whole project into a file so that will be
easy for transfer the project.
2. Choose the path: the archived file with have the extension .zap14 if you use TIA Portal
V14 to archive the project.
Unrestricted © Siemens AG 2017
3. Click Archiving.
Slide 80 SLT / DF FA
A-1 Archiving and Retrieving Project
ForUnrestricted
example,© Siemens
you can
AGchoose
2017 Main OB window and click float, then you can easily drag & drop the I/O
Slide 83 SLT / DF FA
A-2 Convenient tools : Drag & Drop
S7 1200 CPUs do not have physical RUN-STOP switches like other models, but
RUN-STOP can be switched by buttons in the CPU operator panel of TIA Portal
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 88 SLT / DF FA
3. Basic programming 1 : Bit operant
NO
NC
AND
OR
Set
Ptrig
Unrestricted © Siemens AG 2017
Slide 89 SLT / DF FA
3.1 NO (Normally Open)
Absolute Address
Symbolic name
Absolute Address
Symbolic name
Absolute Address
Symbolic name
Absolute Address
Symbolic name
Absolute Address
Symbolic name
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 98 SLT / DF FA
4. Basic programming 2 : Word operant
Timer
Counter
Compare
Mathematic Function
Convert data
Click OK
PT = 700 ms ➔ T#700ms
PT = 5 Sec ➔ T#5s
PT = 10 Minute ➔ T#10m
PT = 8 Hour ➔ T#8h
PT = 5 Day ➔ T#5d
Time set for PT can be a constant or a time type
PT = 1hr, 45min, 30sec, 15ms
variables
➔ T#1h_45m_30s_15ms
Unrestricted © Siemens AG 2017
Slide 100 SLT / DF FA
4.2 Counter
Click OK
4) %Q0.0 turn on
Timer Accumulator
Output result
Add new parameter
input
parameter
Click
to insert new Set data type of
inputs block to REAL
Real
Click Modify
Click OK
(100.0+10.0)x(15.0-5.0) =1100
Unrestricted © Siemens AG 2017
Slide 108 SLT / DF FA
Data type
I3.7 I3.6 I3.5 I3.4 I3.3 I3.2 I3.1 I3.0 I2.7 I2.6 I2.5 I2.4 I2.3 I2.2 I2.1 I2.0 I1.7 I1.6 I1.5 I1.4 I1.3 I1.2 I1.1 I1.0 I0.7 I0.6 I0.5 I0.4 I0.3 I0.2 I0.1 I0.0
I0.7 I0.6 I0.5 I0.4 I0.3 I0.2 I0.1 I0.0 0 IB0 IW0 ID0
Memory I1.7 I1.6 I1.5 I1.4 I1.3 I1.2 I1.1 I1.0 1 IB1
I2.7 I2.6 I2.5 I2.4 I2.3 I2.2 I2.1 I2.0 2 IB2 IW2
I Q M I3.7 I3.6 I3.5 I3.4 I3.3 I3.2 I3.1 I3.0 3 IB3
I4.7 I4.6 I4.5 I4.4 I4.3 I4.2 I4.1 I4.0 4 IB4 IW4 ID4
0 0 0
I5.7 I5.6 I5.5 I5.4 I5.3 I5.2 I5.1 I5.0 5 IB5
1023 1023 xxx Bytes I6.7 I6.6 I6.5 I6.4 I6.3 I6.2 I6.1 I6.0 6 IB6 IW6
Unrestricted © Siemens AG 2017
Slide 109 I7.7 I7.6 I7.5 I7.4 I7.3 I7.2 I7.1 I7.0 7 IB7 SLT / DF FA
Memory
Analog signal module will read the values from input or output with a range of ±10 V, ±5 V, ±2.5 V, 0 – 20 mA
, or 4 - 20 mA, which is calculated into analog input value, the range of analog input value is from -27648 to
27648. Below is the value of the temperature sensor with input range is 4mA to 20mA and the analog input
value range is from 0 to 27648 and the engineering units range is from 50 Celsius degree to 100 Celsius
degree.
4 mA
X Y
20 mA 27648 100%
(X – 0) (Y – 50) (X-0) * (100-50)
= Y = 50 + (27,648-0)
(27,648 – 0)
Unrestricted © Siemens AG 2017
(100 – 50)
Slide 115 SLT / DF FA
4.7 Processing of analog values
Use 2 blocks NORM_X and SCALE_X to normalize and scale the input value to out desired value.
AI
Depended on Depended on
specification engineering
value
Unrestricted © Siemens AG 2017
Slide 116 SLT / DF FA
4.7 Processing of analog values
AI
AO
%IW66
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 122 SLT / DF FA
5. PLC Concept & Programming Concept
PLC concepts
Programming concepts
1. STOP mode: in this mode the CPU will not process the program. You can download the project to the CPU in this mode.
2. OB Startup: this OB will start first and the interrupt OB will be skipped during this OB is processing.
3. RUN mode: in this mode the system will process normally and interrupts will be processed in this mode
Functions (FC) Functions contain program routines for recurring tasks. They have no
"memory".
Function blocks (FB) Function blocks are code blocks that store their values permanently in
instance data blocks, so that they remain available even after the block
has been executed.
Instance data blocks (DB) Instance data blocks are assigned to a function block when it is called
for the purpose of storing program data.
Global data blocks (DB) Global data blocks are data areas for storing data that can be used by
any blocks.
Unrestricted © Siemens AG 2017
Slide 130 SLT / DF FA
5.2 Programming concepts
Name FB
2
Choose FB
Choose program 3
language for FB
M2
M2
M2
M2
You can nest the block calls for a more modular structure. In the following example, the nesting depth is 3:
the program cycle OB plus 3 layers of calls to code blocks.
Main [OB1]
FB
Instance DB
3
4
4
3
Unrestricted © Siemens AG 2017
Slide 159 SLT / DF FA
THANK YOU
siemens.com
Programming Procedure
Basic programming 1
Basic programming 2
Technical note
Appendix
Unrestricted © Siemens AG 2017
Slide 189 SLT / DF FA
6.1 Program information
4
Depended on your network adapters
2
Create new project
5 6
3
2
3
1
4
2
Choose the firmware
7
6
9
Unrestricted © Siemens AG 2017
Slide 197 SLT / DF FA
6.6 Web Server
3 4
5 6 7
Setting password
Unrestricted © Siemens AG 2017 Add user Setting
for user
authorized
Slide 199 user SLT / DF FA
User management
3. Setting Password
New
FW4.2
7
3 4
1
Unrestricted © Siemens AG 2017
Slide 204 2 SLT / DF FA
Using Watch table in Web Server
Download
Unrestricted © Siemens AG 2017 SIMATIC Automation Tool
Slide 213 SLT / DF FA
PRONETA
Commissioning and diagnostics tool for PROFINET networks
Entry type: Application example, Entry ID: 67460624, Entry date: 02/03/2016
https://support.industry.siemens.com/cs/sc/3058/important
-issues-at-a-glance?lc=en-US
Unrestricted © Siemens AG 2017
Slide 215 SLT / DF FA
https://support.industry.siemens.com
2. Type product
3. Click to search
6. Save file
Unrestricted
HMI Setup: Add HMI Device
Method 1 : Drag & Drop in network view
1
2 3
3 2
Click
Your background
will be like this
Choose your
color 2
3
Unrestricted © Siemens AG 20XX
Page 7
HMI Setup: Add HMI Device
Method 2 : HMI Wizard
Your logo
1
Diagnostics
Right
Left
1 2
Drag & drop
3
Choose position of
button bar
Bottom
4
Unrestricted © Siemens AG 20XX
Page 12
HMI Setup: Add HMI Device
Method 2 : HMI Wizard
HMI automatically
generates screen buttons
Flow chart of your follow your screen flow
screens chart
Distance of 2 dots
Text field
With style Dash you can choose Solid : you can choose
fill style Solid / Transparent Transparent
background color
Unrestricted © Siemens AG 20XX
Page 17
HMI – Graphic User Interface
Basic object – Line ( Layout )
60
150
1 2
1
Drag & Drop 2
Click on the object
Diameter in X direction
1
2
2
Drag & Drop
Modify style of text
1 2 4
6
5 X = 182
Y = 110
2
1
Left Top
Centered Middle
Horizontal
2
1
6 7
3D Border
Unrestricted © Siemens AG 20XX
Page 26
HMI Alignment
1 3
3
2 5
Choose all object by
wrapping
3 4 5
1
Choose 1 object as
reference
4
Choose the display
I/O must be assigned with a
format depend on type of
Tag ( PLC tag or HMI tag ).
tag you defined
Here we use tags with type INT
/ REAL for example
5
7
6
1
2
6
5
3
4
2
Unrestricted © Siemens AG 20XX
Page 33
HMI Elements
I/O Field – Appearance
3 4 5
2
Tag should be Integer type
4 5
3
7 6
Display -> Visibility
1
HMI has these type of
movements
3
4
6
Choose your command
2 5
6
3
Tag “data_3” is
assign to the Bar Result
Simulation
1
3
4 2
6
5
Unrestricted © Siemens AG 20XX
7
Page 41
HMI Controls
Alarm
Alarm is a basic function of HMI, it will help the
engineers easier to operate the system with:
➢ Info text which can display the information
(what type of error and how to solve it )
defined by ourselves
➢ Separated colors depending on how
emergency error is
4
1
6
You can input the information
of error and guide to solve
2 Status:
I : Incoming
3 A: Acknowledged
O: Outgoing
Button to open
Info-text Acknowledge button
Alarm view
1 3
I: Alarm comes
1
6
2
Drag & drop
Number of time intervals,
you can set it in time axis
(above) 1
3
6
4
Display color limit
5 lines by setting limit
This is trend values for tag
Unrestricted © Siemens AG 20XX base on time intervals
Page 52
HMI Controls
Trend - simulation
Create some buttons
to simulation the
trend
1
2
5
Unrestricted © Siemens AG 20XX
Page 54
HMI Controls
HTML browser – configure controller to be able to access
3
1
Double-click <Add
new> to create
1
3
2
4
1
4
It means only users in groups which
have “Group 1 authorization” can use
1 this button
3
2
3
2
4
1 9
8
5
6
7
2
Double-click <Add new> to
1 add your recipe ( Ex: Juice )
5
2
6
3
4
7
Unrestricted
Create Data logs
Path of folder we want to store data logs in. Action when data
Default path: C:\USB_X60.1 logs is restarted
3
1
Create tags to be
logged • Cyclic: log at regular intervals. We can
choose the logging cycle ( smallest is 1s
and largest is 1h )
• On change: log as soon as the HMI device
Choose tag detects a change in the value of the tag
• On demand : log by calling the "LogTag"
system function.
➢ When the configured log size has been reached, the oldest entries are deleted.
➢ When the configured log size (data records) has been reached, approximately
20% of the oldest entries are deleted.
After we reached 6
data logs if we keep
logging data, new
data will be logged
and stored in new
data log which is
overwritten oldest
data logs
1 2
3
4
7th record is at
11:12:46”
Then, we need to
1 create a LogTag
6
5
Unrestricted © Siemens AG 20XX
Page 68
How a logging tag with Acquisition mode : On demand works
1
Plug-in USB to HMI (USB
must be plugged in to HMI
before download program,
2 otherwise we need to re-
download program to HMI)
Then plug in USB again to HMI and create a button with events (must in that order):
1. Open all the data log
2. Start logging
➢ Drag&drop to Excel
➢ Open with Excel 5
2
Drag to choose data for Pivot table.
Here, we want to sort data base on: 6
3 name, time, value
4
• Introduction
• Setup boot image file to IOT2000
• Change IP address of IOT2000
• Set date & time
• Node-red and its application
• Each of the 14 digital pins can be used as an input or output, using pinMode(), digitalWrite(),
and digitalRead() functions.
• They operate at 5 volts at nominal 20mA consumption.
• A maximum of 40mA is the value that must not be exceeded on any I/O pin to avoid permanent damage to the
microcontroller.
• Board has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values).
• By default they measure from ground to 5 volts, though is it possible to change the upper end of
their range using the AREF pin and the analogReference() function. There are a couple of other
pins on the board:
• AREF : Reference voltage for the analog inputs. Used with analogReference().
• Reset : Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields
which block the one on the board.
Interfaces Description
ARDUINO GPIO (I2C and SPI free)
Digital Input 5 x DI (24V)
Speed of DI 20 Hz, delay < 1.5 ms
Electrical isolation Yes
Digital outputs 2x DO
Type Transistor
Electrical isolation Yes
Short-circuit protection Yes, 1A
Speed 10 Hz
Analog inputs 2x AI (0 … 10 V or 0 … 20 mA can be selected)
Restricted © Siemens AG 20XX
Resolution 9-bit
Page 9 Electrical isolation –
Introduction
• Hardware
• IOT2000 : either IOT2020 or IOT2040
• Micro-SD card : to keep OS inside from 8GB - 32GB
• PC : as engineering station, with SD card slot and Ethernet port
• Power supply : 9-36V DC
• Software
• Win32 Disk Imager : to put OS image to Micro-SD card (download)
• PuTTY : to setup IOT2000 (download)
• Image file : OS image for IOT2000 (download)
• WinSCP : to transfer file between IOT2000 and PC (download)
• Content after this will assume that you already install all mentioned software and hardware.
Download
image file
• After Win32 Disk Imager is successful, remove SD card from PC and insert in SD card slot of
IOT2000.
• Power on IOT2000, ready state after power up 30 seconds LED should shown as in photo.
• To configure IOT2000, please set IP address of PC to the same subnet as the IOT2000.
192.168.200.xxx
192.168.200.1
Ethernet cable
• Login as “root”
• Now we can change IP of PC to the same subnet as IOT2000 again and test connection with ping
command.
192.168.0.xxx
192.168.0.10
Ethernet cable
• Some feature such as email sending in node-red needs to set correct system time. Otherwise, it
might show “Certification is not yet valid” when you’d like to send email for example.
• Activate “Auto Start node-red”, then Done and quit from this setup.
Dark Light
Page
Theme
Group
Node
Restricted © Siemens AG 20XX
Page 57 XX.XX.20XX Author / Department
Introduction to Node-red
Creating Tab
Dark theme
Light theme
Location of button in
dashboard
• Note:
• Payload can be changed to proper data type to be used.
• For IOT2020, it has only 1 Ethernet port so it has no doubt to connect everything to X1 port.
• But IOT2040 has 2 Ethernet ports, so there are several methods to connect IOT2040 to internet.
192.168.0.200
192.168.1.1
X1: 192.168.0.10 X2: 192.168.1.xx
Default setting DHCP
Internet
OR
192.168.0.100
192.168.0.1
X1: 192.168.0.10 X2: 192.168.0.xx
Just set static IP + gateway DHCP
Internet
192.168.0.100
192.168.0.1
X1: 192.168.0.xx
DHCP or Static IP
Internet
192.168.0.xx
192.168.1.1
X1: 192.168.0.10 X2: 192.168.1.xx
Static IP DHCP
Internet
192.168.0.xx
192.168.1.1
X1: 192.168.0.1 X2: 192.168.1.xx
DHCP
Internet
192.168.0.99
192.168.0.xx
192.168.1.1
X1: 192.168.0.1 X2: 192.168.1.xx
DHCP
Internet
192.168.1.99
192.168.0.101
192.168.1.1
X1: 192.168.0.10 X2: 192.168.1.xx
DHCP
Internet
192.168.0.99
If no internet, it will
fail at this step.
• Prepare data in PLC -> “Permit access with PUT/GET communication for remote partner”
• Prepare data in PLC -> Data block must be “Non-Optimized block access”
Port 102
192.168.0.102:1880/ui/#/1
• No matter the devices are, all can talk each other with same interested topics.
Topic: mysensor
In case we forget or we don’t know the IP address of the SIMATIC IOT2040, we can use this way to get IP
address of SIMATIC IOT2040 whenever it is started
• To export / import node-red program, just use copy and paste by any text-based program to
import / export.
3. Select “all flows” and “formatted”, then Export to clipboard. Copy to any text file such as
Notepad. This is the source file of Node-red program.
1. Copy your Node-red source code, select all and copy it.
3. Paste the copied source code in Import nodes as new flow. Now all nodes and flows are imported.
• https://flows.nodered.org/
• Dashboard is in “/usr/lib/node_modules/node-red-dashboard/dist”
Errors excepted and subject to change without prior notice. The information provided in this document contains merely general descriptions
or characteristics of performance which in case of actual use do not always apply as described or which may change as a result of further development of the
products. An obligation to provide the respective characteristics shall only exist if expressly agreed in the terms of contract.
All product names can include registered trademarks or other rights of the Siemens group
or third parties, the unauthorized use of which may infringe the rights of the owner.
siemens.com/iot2000