PLC Programming with TIA Portal Guide
PLC Programming with TIA Portal Guide
[Link]
Programmable Logic Controller
A programmable logic controller or programmable controller is an industrial computer that has been
ruggedized and adapted for the control of manufacturing processes, such as assembly lines, machines,
robotic devices, or any activity that requires high reliability, ease of programming, and process fault
diagnosis.
1. 2.
1. Fixed/Integrated/Compact PLC
2. Modular PLC
1. Relay Output
2. Transistor Output
3. Triac Output
4. Analog Output
[Link]
PLC Hardware
HMI
Human Machine Interface [Link]
What are Input/Output devices?
An input device is a piece of computer hardware An output device is any piece of hardware used to
equipment used to provide data, and control communicate the results of data processing carried
signals to an information processing system (IPS). out by an IPS and translate the information into an
o Switches and push buttons understandable form.
o Sensing devices o Valves
o Limit switches o Motor starters
o Proximity sensors o Horns and alarms
o Photoelectric Sensors o Stack lights
o Condition sensors o Control relays
o Vacuum switches o Pumps
o Temperature switches o Printers
o Level switches o Fans
o Pressure switches
Push Button Sensor Limit Switch Pressure Switch Valve Contactor Relay Buzzer
[Link]
Connection and Construction of PLC
[Link]
Scan Time
Time taken by the PLC to read the inputs, solve the Logic, and to
write the output is called a PLC Scan Time.
Read
Input
Scan Time depends on-
o Number of inputs
o Number of outputs
o Length of logic
o Speed of PLC processor
o Nature of Input/Output (I/O) signals
Update Scan Execute
Output Program
Cycle
Nature of Input/Output (I/O)
o Digital Inputs
o Digital Outputs
o Analog Inputs Diagnostic
o Analog Outputs &
Communicatio
n
[Link]
Connection and Construction of PLC
[Link]
Input Module Circuit
Connection and Construction of PLC
[Link]
Input Module Circuit
Connection and Construction of PLC
[Link]
Input Module Circuit
Connection and Construction of PLC
[Link]
Output Module Circuit
Connection and Construction of PLC
[Link]
Output Module Circuit
Connection and Construction of PLC
Input Output
CPU
Module Module
[Link]
Connection and Construction of PLC
Input Output
CPU
Module Module
[Link]
Connection and Construction of PLC
Input Output
CPU
Module Module
[Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link]
Communication System
[Link]
RS232 and RS485
RS232
RS485
[Link]
RS232 pinout standards exist for both DB9 and
DB25 connectors as shown below
DB25 SIGNAL DB9 DEFINITION
1 Protective Ground
2 TXD 3 Transmitted Data
3 RXD 2 Received Data
4 RTS 7 Request To Send
5 CTS 8 Clear To Send
6 DSR 6 Data Set Ready
7 GND 5 Signal Ground
8 CD 1 Received Line Signal Detector
9 Reserved for data set testing
10 Reserved for data set testing
11 Unassigned
12 SCF Secndry Rcvd Line Signl Detctr
13 SCB Secondary Clear to Send
14 SBA Secondary Transmitted Data
15 DB Transmisn Signal Timng
DB25 16 SBB Secondary Received Data
RS232 17 DD Receiver Signal Element Timing
18 Unassigned
19 SCA Secondary Request to Send
20 DTR 4 Data Terminal Ready
21 CG Signal Quality Detector
22 9 Ring Indicator
23 CH/CI Data Signal Rate Selector
24 DA Transmit Signal Element Timing
25 Unassigned
DB9, DB25 and RJ45 Connectors
25 Pin DB25
8 Pin RJ45
RJ45
[Link]
➢ HTTP Hypertext Transfer Protocol
➢ HTTPS Hypertext Transfer Protocol Secure
➢ FTP File Transfer Protocol
➢ SMTP Simple Mail Transfer Protocol
➢ DNS Domain Name System
➢ SNMP Simple Network Management Protocol
➢ TCP Transmission Control Protocol
➢ UDP User Datagram Protocol
➢ ARP Address Resolution Protocol
➢ IP Internet Protocol
➢ ICMP Internet Control Message Protocol
➢ DLL Dynamic Link Library
[Link]
The CPU can communicate with other CPUs, with programming devices, with HMI devices, and with non - Siemens
devices using standard TCP communications protocols.
[Link]
The PROFINET port on the CPU 1211C, 1212C, and 1214C does not contain an Ethernet switching device. A direct
connection between a programming device or HMI and a CPU does not require an Ethernet switch. However, a
network with more than two CPUs or HMI devices requires an Ethernet switch.
[Link]
Communication between two CPUs
➢ The TSEND_C instruction in CPU_1 links to the TRCV_V in CPU_2 over the first connection ("connection ID 1" on
both CPU_1 and CPU_2).
➢ The TRCV_C instruction in CPU_1 links to the TSEND_C in CPU_2 over the second connection ("connection ID 2"
on both CPU_1 and CPU_2).
[Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link]
Siemens PLC Series
• Compact PLC with • Compact or • It is a rack- • Medium and Low • Advanced and Modular • Distributed I/O
onboard I/Os Modular PLC based system end performance controller • With or Without CPU
• Micro PLC for lower • It is a bus-linked • High range • High and Medium end • Modular PLC
performance range platform performance • Compact PLC with performance • High and Medium end
• Software: Step 7 • Medium and Low and medium onboard I/Os • High system performance performance
Microwin end performance range • It has a very high • up to 32 expansion • Software: TIA Portal
• It has 38 Analog I/O range • Modular PLC processing speed modules as needed to fit • Communication:
capacity and 256 • Technology T • For process • High and Medium your project Ethernet / ProfiNet
Digital I/O capacity version automation end performance • S7-1500 has an inbuilt
• Communication: • Software: Simatic • DCS • Software: TIA Portal display and keypad
RS485 Manager applications • Communication: • Software: TIA Portal
• Models: CPU 221, • Communication: • Software: TIA Ethernet • It has inbuilt PROFINET
222, 224, 224XP, Profibus Portal ports
224XPsi, 226 • Cable: MPI DP / • Communication: Ethernet
• Boolean execution Profibus DP / ProfNet
speed: 0.22 • Software: PCS7
microseconds/instruc Package
tion
Fanuc I/O Board
Siemens S7-200
The S7-200 series of micro-programmable logic controllers (Micro PLCs)
can control a wide variety of devices to support your automation needs.
The S7-200 monitors inputs and changes outputs as controlled by the
user program, which can include Boolean logic, counting, timing,
complex math operations, and communications with other intelligent
devices. The compact design, flexible configuration, and powerful
instruction set combine to make the S7-200 a perfect solution for
controlling a wide variety of applications.
[Link]
Siemens S7-300
The Siemens PLC CPU provides more power and additional features with
an easy and simple upgrade path from the S7-200 series PLCs and
includes many of the common features and instructions found in other
models within the range. It is a compact CPU with a wide range of special
attributes like 192KB work memory, 2-port switch, 1 Pt100 sensor, 4 high-
speed counters (60kHz), front connector (2x 40-pole) and a micro
memory card.
• MPI interface for communications with other controllers and
operator panels
• Enhanced communication is possible using either of the two PtP
interfaces (1xRS485 serial interface)
• Communication interface like MPI
• CPU has integral counters, frequency measurement capabilities
and PWM outputs enabling direct control of valves and
actuators
• Simple motion control is possible without additional
components
[Link]
Siemens S7-400
[Link]
Siemens S7-1200
[Link]
Siemens S7-1500
The SIMATIC S7-1500 is the further development of the SIMATIC S7-300 and
S7-400 automation systems. Through the integration of numerous new
performance features, the S7-1500 automation system offers the user
excellent operability and the highest performance. The new performance
features are:
● Increased system performance
● Integrated Motion Control functionality
● PROFINET IO IRT
● Integrated display for machine-oriented operation and diagnostics
● STEP 7 language innovations with retention of proven functions
[Link]
Introduction of S7 - 1200 PLC
The S7-1200 controller provides the flexibility and power to control a wide variety of devices in support of your automation needs. The CPU
combines a microprocessor, an integrated power supply, input and output circuits, built-in PROFINET, high-speed motion control I/O, and on-board
analog inputs in a compact housing to create a powerful controller. The CPU monitors the inputs and changes the outputs according to the logic of
your user program, which can include Boolean logic, counting, timing, complex math operations, and communications with other intelligent
devices.
The CPU provides a PROFINET port for communication over a PROFINET network. Additional modules are available for communicating over
PROFIBUS, GPRS, RS485 or RS232 networks.
[Link]
Specifications of Siemens
S7 1200 1211C DC/DC/DC 6ES7211-1AE40-0XB0
• Physical size (mm) : 90 x 100 x 75
• User memory : Work 30 Kbytes, Load 1 Mbyte
and Retentive 10 Kbytes
• Digital I/O : 6 inputs/4 outputs
• Analog I/O : 2 inputs
• Process image size : Input (I)/Output (Q) 1024
bytes, 1024 bytes
• Bit memory (M) : 4096 bytes
• Signal module (SM) expansion : None
• Signal board (SB), Battery board (BB) and
Communication board (CB) :1
• Communication module (CM) (LS Expansion) :3
• High-speed counters : Total- 3 built-in I/O, 5 with SB
Single phase- 3 at 100 kHzSB: 2 at 30 kHz
Quadrature phase 3 at 80 kHz SB: 2 at 20 kHz
• Pulse outputs1 :4
• Memory card : SIMATIC Memory card (optional)
• Real time clock retention time : 20 days, typ. / 12 days min. at 40 degrees C
(maintenance-free Super Capacitor)
• PROFINET : 1 Ethernet communication port
• Real math execution speed : 2.3 μs/instruction [Link]
• Boolean execution speed : 0.08 μs/instruction
• Comparing the CPU models • Blocks, timers and counters supported by S7-1200
[Link]
• Expansion capability of the CPU
The S7-1200 family provides a variety of modules and plug-in boards for expanding the capabilities of the CPU with additional I/O or other
communication protocols.
1. Communication module (CM), communication processor (CP), or TS Adapter
2. CPU
3. Signal board (SB), communication board (CB), or Battery Board (BB)
4. Signal module (SM)
[Link]
• Expansion capability of the CPU
The S7-1200 family provides a variety of modules and plug-in boards for expanding the capabilities of the CPU with additional I/O or other
communication protocols.
1. Communication module (CM), communication processor (CP), or TS Adapter
2. CPU
3. Signal board (SB), communication board (CB), or Battery Board (BB)
4. Signal module (SM)
Communication interfaces
Other boards
[Link]
S7-1200 expansion modules
[Link]
• CPU 1211C DC/DC/DC (6ES7 211-1AE31-0XB0)
General
CPU features
[Link]
Timers, counters and code blocks supported by CPU 1212C
[Link]
• Communication • Power supply
Technical Specifications
Sensor power
[Link]
• Digital/Analog inputs and outputs
Digital Inputs
Analog Inputs
Digital outputs
[Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link]
AND, OR or NOT logic Gates
X1 X1 Input Output
Input X1 . X2 Input X1 + X2
X2 Output X2 Output
AND Gate OR Gate NOT Gate
[Link]
AND Logic Gate
X0 X1 Output
OFF OFF OFF
OFF ON OFF
ON OFF OFF
ON ON ON
X1
Input X1 . X2
X2 Output
AND Gate
[Link]
OR Logic Gate
X0 X1 Output
OFF OFF OFF
OFF ON ON
ON OFF ON
ON ON ON
X1
Input X1 + X2
X2 Output
OR Gate
[Link]
NOT Logic Gate
X0 X1 Output
OFF OFF OFF
OFF ON OFF
ON OFF ON
ON ON OFF
Input Output
NOT Gate
[Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link]
CPU 1211C DC/DC/D
(6ES7 211-1AE31-0XB0)
Output type:- Solid State- MOSFET
(Sourcing)
[Link]
CPU 1211C DC/DC/Relay
(6ES7 211-1HE31-0XB0)
Output type:- Relay, dry contact
[Link]
CPU 1211C AC/DC/Relay
(6ES7 211-1BE31-0XB0)
Output type:- Relay, dry contact
[Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link] or [Link]
PLC Tags (Absolute vs Symbolic)
“%I0.0” is Absolute Address (Logical Address in CPU Language)
%I0.0
Limit Switch
“Limit Switch” is Symbolic Address (Human Language)
7
6
5
Where “I” Indicates input image
“0” Represents Byte Zero 4
“.” is period separating Bit address 3
“0” Indicates Bit Zero
2 Byte
1
% character indicates it is an absolute address. Step 7
automatically supplies it if omitted 0
7 6 5 4 3 2 1 0
Bits
[Link] or [Link]
PLC Addressing and Data Types
Byte
7 6 5 4 3 2 1 0
Bit
I 0 . 0 M 0 . 0 Y 0 . 0
Code Register No. Bit Code Register No. Bit Code Register No. Bit
[Link] or [Link]
PLC Addressing
NO Push Button- II
NO Push Button- I
Selector Switch - II
Selector Switch - I
Limit Switch
NC Push Button
Pressure Switch
[Link] or [Link]
Below are the available basic data types:
Types Description Values Prefixes
Single precision floating point stored in 32 bits -3.4E38 to 3.4E38 and -3.4E-38 to 3.4E-38 (6 to 7 LREAL# ++
REAL ++
significant digits of accuracy)
Single precision floating point stored in 64 bits -1.7E308 to 1.7E308 and -1.7E-308 to 1.7E-308 (14 to LREAL#
LREAL ++
15 significant digits of accuracy)
TIME Time data types is used to specify a time variable- accuracy is 1ms. 0ms to 24h T# OR TIME#
STRING Variable length string with declared maximum length, Each character is store on 1 byte Maximum length cannot exceed 255 characters
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link] or [Link]
Fanuc Manual Pulse Generator
Manual pulse generators are typically rotating knobs that generate electrical pulses. They are normally associated
with computer numerically controlled (CNC) machinery or other devices involving positioning. When the pulse
generator sends an electrical pulse to an equipment controller, the controller then moves a piece of equipment a
predetermined distance with every pulse.
[Link] or [Link]
[Link] or [Link]
Programmable Logic Controller
(PLC Programming With TIA Portal)
S7- 1200 CPU 1211C DC/DC/DC
[Link] or [Link]
Understanding Fundamentals of Analog Inputs
[Link] or [Link]
Analog Scaling
[Link] or [Link]