MSD Exp3 PDF
MSD Exp3 PDF
MSD Exp3 PDF
Theory
2
Mechatronics Systems Design Lab
3
Mechatronics Systems Design Lab
You can notice from figure 2 that the common of the digital input module is connected to the
ground of the circuit while the common of the digital output module is connected to the power
source.
The last figure shows a switch connected to the input I0.0 in the digital input module, and an
LED connected to the output Q0.0 in the output module.
Ladder Logic Programming
Figure 3 shows electrical continuity, when SW1 is closed, the current will flow from L-1 to L-2
and energize the load.
Even though PLC ladder logic was modeled after the conventional relay ladder, there is no
electrical continuity in PLC ladder logic. PLC ladder rungs should have logical continuity in
order for the output to be energized. PLC ladder program uses familiar terms like “rungs”,
“normally open” and “normally closed” contacts, as illustrated in table 2.
4
Mechatronics Systems Design Lab
Table 2: Fundamental contacts and coils instructions of PLC ladder logic programming
In a ladder logic program, there is no physical conductor that carries the input signal through to
the output. Each rung in the ladder diagram is a program statement. This program statement
consists of a condition or sometimes conditions, along with some type of action.
Inputs are the conditions, and the action, or output, is the result of the conditions. As in case of
physical wiring hardware devices connected in series or parallel, PLC also combines ladder
program instructions in series or parallel. However, rather than working in series or parallel, the
PLC combines instructions logically using logic operators like: AND, OR, and NOT. These
operators are used to combine the instructions on a PLC rung to make the outcome of each rung
either true or false.
1. AND-logic function:
A series circuit of two switches can be regarded as AND logic function. In figure 4, both
switches (SW1 AND SW2) must be closed to have electrical continuity to energize the
output (Light-1). Hence the keyword here is AND.
5
Mechatronics Systems Design Lab
The circuit shown in figure 5 represents a schematic ladder logic rung for the circuit
shown in figure 4. When switch 1 and switch 2 are closed the output coil will be
energized.
The circuit shown in figure 7 represents a schematic ladder logic rung for the circuit
shown in figure 6. If switch 1 or switch 2 is closed the output coil will be energized.
6
Mechatronics Systems Design Lab
Equipment
1) Computer with SIMATIC software.
2) Siemens S7-400 PLC.
3) LEDs.
4) Switches.
5) Connecting wires.
6) Motor.
7) Limit switches.
Procedures
To write and download a ladder diagram using SIMATIC Manager software, do the following
steps:
1. Run SIMATIC Manager software.
2. Start a new project wizard, then click on “Next”.
3. Select the appropriate CPU type, then click on “Next”. You can check the type and order
no. from the hardware.
4. Choose “LAD” since we are going to use ladder diagram programming, then click on
“Next”.
5. Write a name for your project, then click on “Finish”.
7
Mechatronics Systems Design Lab
6. Click in the left half of the project window on the box containing a plus sign to display
the full tree structure of the project. The resulting structure will look something like
figure 9. Double click on “SIMATIC 400 Station” then choose “Hardware”.
8
Mechatronics Systems Design Lab
1- Write down the Boolean sum-of-product expression for NOR logic function, see table 4.
9
Mechatronics Systems Design Lab
10
Mechatronics Systems Design Lab
Hints:
1) Use the idea of an interlock (electrical and mechanical); to prevent the situation of
pressing the backward and forward pushbuttons at the same time, and stop the motor
when it reaches its maximum limits.
2) Use the idea of state coil pattern since we are using pushbuttons to control the direction
of motion.
Discussion and Conclusions
1- Discuss the advantages of PLC controllers in comparison with general purpose
computers.
2- Illustrate the operation of sealed in coil pattern? How it can be de-energized?
3- Illustrate the operation of state coil pattern? How it can be de-energized?
4- Illustrate the operation of start/stop circuit pattern?
5- What is the main difference between state coil pattern and start/stop circuit pattern?
6- Mention four different applications where the PLC can be used?
7- Illustrate the mechanical and electrical interlocks?
11