PLC Hardware Setup Guide
PLC Hardware Setup Guide
Specification
Device name : Power Supply Model
No : SITOP PSU100L
8
Specification
Device name : SIMATIC S7-1200, CPU 1214C, COMPACT CPU, DC/DC/DC
Model No : 6ES7214 -1AG40- 0XB0
Power Supply : DC 20.4 - 28.8 V DC, 1.5A
Digital Input : 14 Digital Input, 24V DC
Digital Output : 10 Digital Output, 24 V DC
Analog Input : 2 Analog Input, 0 - 10V DC
Memory : 100 KB
Connection of CPU
This is basically a DC/DC/DC PLC, so the input and output of the CPU will be 24VDC. For
powering the CPU properly, see the diagram below:
Fig 2.4: Pin diagram of the CPU 1214C DC/DC/DC PLCFollow these steps
carefully:
9
Now, put a wire to the 2nd L+ of the CPU and connect it with the one terminal of all switches
as a switch needs only phase connection not neutral. But in this case one terminal of all
switches and push buttons are internally shorted and a point is connected to a female port.
So just put a wire from L+ and connect with that specific female port where the shorted
terminals come. Connect the 2nd M and 1M terminal by a wire. In the board three inputs
from the CPU are taken to the female connector.
The other terminals of switches will be connected to that specific port as which input tag
is defined in the Ladder Diagram. For example, if input I0.0 is taken in program then the
terminal of a switch will be connected in port 0 in 24VDC input section.
For analog input connection, you may use a potentiometer or a DC power supply module
which are normally used in our laboratory (Not PLC Power Supply Module because it
provides a fixed voltage of 24V, but we need a variable voltage of 0 to 10V for analog
inputs). If potentiometer is used you have to connect another 24V DC to the two terminals
of the potentiometer and vary the voltage within 0-10V by potentiometer. But if power
supply is used directly then potentiometer is useless. Just simply connect the positive of
the supply or potentiometer to the 0 or 1 port in analog input section and connect the
negative of supply or potentiometer to the 2M port.
For digital output connection, take another power supply from the power supply module
and connect the positive to 3L+ and connect the negative terminal to the 3M port. The one
terminal of a output (LED) is connected with respective port(0 or 1 or 2 ; based on the
program) and the negative terminals of all LEDS are internally shorted and connected in a
female port. Just connect it with the 3M of the output section where the supply negative
comes.
10
earlier. The port M and 1M is shorted. Now the other terminals of respective switches areconnected
to their respective ports e.g. 0,1,2 of the SM-1223 module. In the board two inputs are taken from
the module.
The bottom section is for output connection, no power supply is required here. Just simply
short the one terminals of all LED and connect with the M (Which are previously done).
11
Specification
The module SM-1231 indicates the analog input module. This module takes analog data from sensor
like temperature sensor or pressure sensor in industry. But in this case, a external power supply is
taken for working as a sensor. A potentiometer also can be used. In that case a 24V mustbe supplied
in the two terminals of the potentiometer. But for better visualization power supply can be used. The
supply voltage is varied and check the same voltage in output. But here one thingmust be noticed that
we can’t visualize the output in the board because LED works on basically digital mode. The working
of analog module will be described in the Experiment subsection in theMethodology section. The
main CPU module has also analog input section but here analog input is taken from the module.
Fig 2.7: Pin diagram of the Analog input moduleThe module has basically
Connect the supply in L+ and M. Ground connection is not necessary. Now connect the
positive terminal of the power supply to 0+ and negative to 0- or 1+ and 1- and so on.
Here V or I indicates that that the analog data may be a voltage of 0 to 10V or a current of
4 to 20 mA.
12
2.5 : Analog Output Module
The CPU 1214C doesn’t support any analog output. The analog output module consists of two
sections. The top section is used for power supply as shown in figure.
Specification
Model No : 6ES7 232-4HD32-0XB0
For connecting the module,
RTD stands for Resistance Temperature Detector. It is basically a PT100 temperature sensor which has
3 wires. When temperature changes the resistance varies. This type of sensors are widely usedin the
industry. But for experimental purpose here a potentiometer is used in stead of a sensor.
Specification
Model No : 6ES7 231-5PD32-0XB0
13
Fig 2.9: Pin diagram of Analog RTD module
The device is used for visualization. The program which is running in the hardware that can be
checked by HMI screen. But one thing must be remembered that the same program which is uploaded
in PLC CPU also needs to be uploaded in HMI . A power supply is to be given through
14
the connector which is given in the module box. The same ethernet cable may be used for uploading
the program in PLC CPU as well as HMI. For visualizing the logic, some animation ordesigns are to
be drawn in the code which will be shown in the experiment section.
Specification
SIMATIC HMI KTP400 Basic Panel
4” display
Model No: 6AV2-123-2DB03-0AX0
15
Chapter 3 Software Description
3.1 : Installation and Activation
Download Link:
https://support.industry.siemens.com/cs/document/109761045/simatic-step-7-and-wincc-v15-1-trial-
download?dti=0&lc=en-WW
The following files needed to be downloaded.
16
Fig 3.2: .Downloaded files. Sim_EKB_Install_2018_11_14 is license
key file and will be found in plc4me.com
You can extract the installation files without installation in two different folders for TAI
Portal and PLCSim. For that, creat two folders first. Then right click on the
“TIA_Portal_STEP_7_Pro_WINCC_Pro_V15_1.exe” file and run as administrator. Then follow
the following steps:
Yes>Next>Next>Click/Check the option “Extract the setup files without being installed”
and browse and choose the folder which was created to save the installation files for TIA
Portal.
After the files are extracted in the folder, do the same for the
“SIMATIC_S7PLCSIM_V15_1.exe” file.
17
Fig 3.5: may be asked for restart
18
Fig 3.6: few steps
19
Thus following few steps, TIA Portal installation is completed.
PLCSIM file
20
Thus following few steps, simulation part is also completed.
Select here
But before that, virus & threat protection settings and windows defender firewall settings must be
turned off.
21
Fig 3.2: virus and threat protection settings are off
22
Fig 3.3: windows defender firewall settings are off
Key file
Open this
Find “ Required keys ” and select all keys and click on “ Install Long ” .
23
Click here
24
Fig 3.16: select all
25
3.2 : Creating a Project in TIA Portal V15.1
To create a project, open TIA Portal V15.1 and a portal like fig 3.19 will pop up. To run a new code,
open “ create new project ” and to view previous codes, go to “ open existing project ”. In creating
new project, select a project name and set the file location and then create new project.
26
Fig 3.21: select cpu model
Now other modules have to be selected, so click on “ Hardware catalog ” and select DI/DQ, AQ,
AI, AI RTD specified models as shown below.
27
Fig 3.24: AQ module selection
28
Fig 3.27: complete configuration
Device configuration is complete here. Now we will try a simple ladder diagram.
PLC_1 > Program blocks > Main [OB1]
Then a page like fig 3.28 will pop up and we will design ladder diagram on it.
Our next target is to draw a simple ladder diagram and learn to download to device, start
simulation, PLCSIM simulation etc.
29
3.3 : Simulation Process in PLCSIM
Let’s take a simple ladder diagram in fig 3.29 of a output (LED) on/off with input switch. Then
press “start simulation”.
Start
simulation
30
Fig 3.31: load to device
31
Fig 3.33: start module
Press here
32
Fig 3.35: open new project on PLCSIM
33
Fig 3.38: load tag table in PLCSIM
34
Fig 3.41: input switch closed (true)
35
Fig 3.43: input switch open (false)
36
3.4 : Interfacing HMI
To add HMI on your code, click ”Add new device” from left side.
Fig 3.45: Click the part as indicated by arrowsThen, Select our HMI with
proper model
37
Next, click “Browse” and then the CPU will be connected to the HMI virtually.
38
Chapter 4 Methodology
This chapter will describe the main training board and it’s accessories. All things–how connectionsare
provided between the modules are provided, how to upload code and how the output can be checked
etc. will be discussed in this chapter.
In the upper side all modules are fixed in the board by a rail. The rail is commercially called MCB
channel mainly. There are 5 modules on each board. They are: PLC CPU (S7-1214C DC/DC/DC,
Digital Input/Output Module (SM-1223), Analog Output Module (SM-1232), Analog InputModule
(SM-1231) and Analog RTD Module (SM-1231) and finally a Power Supply Module (SITOP
PSU100L).
Fig 4.1: A sample training board and its 3 sections as indicated by arrows
The input output section is made by a Veroboard. It has 3 switches and 4 push buttons as input.
There is an indicator LED is used in every switch and push button. When the switch/push button
39
is pressed the blinking of LED will indicate that logic is working. It also helps in finding the faultof
the system. The output section has 6 LED which will work based on the logic.
The female connector is provided to avoid the opening of PLC screws all times for experiments. It
has 18 holes in each board. In one side of the holes, connections from the Veroboard are given and
in other side the connections from the different modules is given.
There are 3 switches and 4 push buttons can be used as input. For providing experience of working
with all modules, 2 push buttons and one switch is taken from CPU and 1 push button and 1 switchis
taken from DI/DQ module. So, there are 5 inputs are connected in the female connector. But if you
need more inputs, you can use the other two input by connecting via the female connector.
In the output section, there are 6 LEDs. Two of them are taken from CPU and other two are taken
from DI/DQ module. To avoid confusion, see the picture and description below:
We have 18 ports in female port segment, where first 8 ports (from left) are used for inputs like
switch or push button and then 2 ports are used as power supply of 24V ( positive and negative), next
port is unused and last 7 ports are used for LEDs section or outputs.
40
Female Connector Pin Assignment
41
4.2 : Experiment 1 : Metal Element Sensing by SIEMENS S7-1200 PLC
Problem Description
There will be one push button as metal sensor. When the push button will be pressed, the LED willbe
ON, a timer will be used to keep ON the LED for 5 seconds.
Experimental Setup
Latching is not needed so much because when the push button is pressed, timer will keep the output
LED on for 5 seconds and then output LED will be turned off.
All connections are given in the board. Just make the I/O assignments:
Ladder Diagram
42
Experimental Results
When “Metal sensor” is not pressed, LED_1 is OFF and when push button is pressed, LED_1 is
ON for 5 seconds.
Problem Description
43
Fig 4.5: Block diagram of given problem
Experimental Setup
3 push button is used as player 1,2,3 and RST (reset) as host switch. Latching is very important here
to keep the LEDs ON. If any player presses his push button, his LED will be ON and buzzerLED
will be ON for 10 seconds. Full system will shut down when RST switch is pressed.
Input Device
I1 PB1
I2 PB2
I3 PB3
I4 RST (Reset)
44
Output Device
Q1 Buzzer
Q2 Player 1 light
Q3 Player 2 light
Q4 Player 3 light
Ladder Diagram
Experimental Results
When any player will push his button, his LED and buzzer LED will be ON for 10 seconds. When
host switch will be pressed, full system will shut down like reset.
45
Fig 4.7: ‘player 1’ push is pressed and Buzzer is ON
46
Fig 4.9: RST is pressed and LEDs are OFF
4.4 : Experiment 3 : Analog Input to Digital Output Conversion by SIEMENS S7-1200 PLC
Problem Description
This problem is about analog to digital data conversion. Here we will take voltage from power supply
at a range of 0 – 10 V as analog data. Then a comparator is used as if voltage is less than 5V, then
digital output is high (24V) and otherwise output is low (0V) to show digital output.
Experimental Setup
Voltage from power supply is given in AI port 0+, 0_ ( address-128, but this may change later as the
sequence of modules). Then it is compared with fixed Value as given logic and out is observedin Q0.1.
47
Table 6 : Modules for exp-3
Input %W128 (0 – 10 V)
Output Port Q0.1
Ladder Diagram
Experimental Results
This is DC/DC/DC PLC, so AQ port can be used but can’t check voltage here. That’s mean we can’t
observe analog output, we have to shift it into digital output ports. And here, output is observed in
Q0.1 port. If analog output module someone want to add, just replace the memory location %MD24
with analog output port address and all connection is unchanged.
48
Fig 4.11: Analog voltage is greater than fixed value
49
4.5 : Experiment 4 : Direction Control of DC Gear Motor by SIEMENS S7-1200 PLC
Problem Description
DC gear motor has to operate on forward or reverse mode. And must have to check that motormust
be stopped first, then have to shift on other mode.
Experimental Setup
We need 4 inputs as forward start, stop and reverse start, stop. So, let’s take 4 push buttons. And we
need 2 output to show that the motor is in forward or reverse mode. That’s why take just 2 LEDs.
Here we also add HMI to observe and compare with physical connection.
Input Device
I0.1 Start Forward
I0.2 Stop Forward
I8.1 Start Reverse
I8.2 Stop Reverse
Output Device
Q0.0 Forward Motor
Q0.1 Reverse Motor
50
Ladder Diagram
51
Experimental Results
52
4.6 : Experiment 5 : Automatic Electrical Interlocking in Power System
Problem Description
We know that to activate a line to power grid, we must open the earthing switch, then close the
isolator and at last circuit breaker has to be closed. If we don’t follow the sequence, system must
detect it and the line should not be active or connect to grid.
Experimental Setup
We need 3 inputs for ES, CB and Isolator and 3 LEDs for indicating ES, CB or Isolator is open or
closed and finally one LED for indicating that line is ready to connect with grid or not.
Input Device
I0.0 Earthing Switch
I8.0 Circuit Breaker
I0.3 Isolator
Output Device
Q0.0 ES LED
Q0.1 CB LED
Q8.0 Iso LED
Q8.1 Line LED
53
Ladder Diagram
Experimental Results
54
Fig 4.20: Isolator closed
55
4.2 : Experiment 1 : Metal Element Sensing by SIEMENS S7-1200 PLC
Problem Description
There will be one push button as metal sensor. When the push button will be pressed, the LED willbe
ON, a timer will be used to keep ON the LED for 5 seconds.
Experimental Setup
Latching is not needed so much because when the push button is pressed, timer will keep the output
LED on for 5 seconds and then output LED will be turned off.
All connections are given in the board. Just make the I/O assignments:
Ladder Diagram
39
Experimental Results
When “Metal sensor” is not pressed, LED_1 is OFF and when push button is pressed, LED_1 is
ON for 5 seconds.
Problem Description
40
Fig 4.5: Block diagram of given problem
Experimental Setup
3 push button is used as player 1,2,3 and RST (reset) as host switch. Latching is very important here
to keep the LEDs ON. If any player presses his push button, his LED will be ON and buzzer LED
will be ON for 10 seconds. Full system will shut down when RST switch is pressed.
Input Device
I1 PB1
I2 PB2
I3 PB3
I4 RST (Reset)
41
Output Device
Q1 Buzzer
Q2 Player 1 light
Q3 Player 2 light
Q4 Player 3 light
Ladder Diagram
Experimental Results
When any player will push his button, his LED and buzzer LED will be ON for 10 seconds. When
host switch will be pressed, full system will shut down like reset.
42
Fig 4.7: ‘player 1’ push is pressed and Buzzer is ON
43
Fig 4.9: RST is pressed and LEDs are OFF
4.4 : Experiment 3 : Analog Input to Digital Output Conversion by SIEMENS S7-1200 PLC
Problem Description
This problem is about analog to digital data conversion. Here we will take voltage from power supply
at a range of 0 – 10 V as analog data. Then a comparator is used as if voltage is less than 5V, then
digital output is high (24V) and otherwise output is low (0V) to show digital output.
Experimental Setup
Voltage from power supply is given in AI port 0+, 0_ ( address-128, but this may change later as the
sequence of modules). Then it is compared with fixed Value as given logic and out is observed in Q0.1.
44
Table 6 : Modules for exp-3
Input %W128 (0 – 10 V)
Output Port Q0.1
Ladder Diagram
Experimental Results
This is DC/DC/DC PLC, so AQ port can be used but can’t check voltage here. That’s mean we can’t
observe analog output, we have to shift it into digital output ports. And here, output is observed in
Q0.1 port. If analog output module someone want to add, just replace the memory location %MD24
with analog output port address and all connection is unchanged.
45
Fig 4.11: Analog voltage is greater than fixed value
46
4.5 : Experiment 4 : Direction Control of DC Gear Motor by SIEMENS S7-1200 PLC
Problem Description
DC gear motor has to operate on forward or reverse mode. And must have to check that motor must
be stopped first, then have to shift on other mode.
Experimental Setup
We need 4 inputs as forward start, stop and reverse start, stop. So, let’s take 4 push buttons. And we
need 2 output to show that the motor is in forward or reverse mode. That’s why take just 2 LEDs.
Here we also add HMI to observe and compare with physical connection.
Input Device
I0.1 Start Forward
I0.2 Stop Forward
I8.1 Start Reverse
I8.2 Stop Reverse
Output Device
Q0.0 Forward Motor
Q0.1 Reverse Motor
47
Ladder Diagram
48
Experimental Results
49
4.6 : Experiment 5 : Automatic Electrical Interlocking in Power System
Problem Description
We know that to activate a line to power grid, we must open the earthing switch, then close the
isolator and at last circuit breaker has to be closed. If we don’t follow the sequence, system must
detect it and the line should not be active or connect to grid.
Experimental Setup
We need 3 inputs for ES, CB and Isolator and 3 LEDs for indicating ES, CB or Isolator is open or
closed and finally one LED for indicating that line is ready to connect with grid or not.
Input Device
I0.0 Earthing Switch
I8.0 Circuit Breaker
I0.3 Isolator
Output Device
Q0.0 ES LED
Q0.1 CB LED
Q8.0 Iso LED
Q8.1 Line LED
50
Ladder Diagram
Experimental Results
51
Fig 4.20: Isolator closed
52