You are on page 1of 12

Control Laboratory

Fourth Year

Experiment no.1

Program Editing, Simulation, and Practical


Interfacing of PLC

Student's Name:

Student's No.:

Type of Studying:

PLC Lab – Fourth Year Page 1


Objective
1- Illustrate XG5000 simulator based on PLC environment through all required steps
to edit and create a program.
2- Explore the hardware structure of a PLC kit.
3- Design a simple project and simulate its behavior by XG5000.
4- Practically implement and interface a simple project between a PC and a PLC.

Introduction
A Programmable Logic Controller is called a PLC. PLCs are special-purpose industrial
computers designed for use in the control of a wide variety of manufacturing machines
and systems. In addition, a PLC is a specialized electronic device based on one or more
microprocessors that is used to control industrial machinery. XG5000 is a software tool
designed to program and debug XGT PLC series with the following features and merits. It
allows users to edit, monitor or manage PLC system interlocked with several PLC
included in a project at the same time. Additionally, the program can be made as
divided into Scan programs and various Task programs. Furthermore, XG-SIM is a
Windows-based virtual PLC for XGT PLC series. If using XG-SIM, an operator may execute
a created program without PLC and debug a PLC program by using the functions of input
setup and module simulation. XG-SIM supports the following functions:

1) Program simulation

An operator can simulate a program created by either Ladder Diagrams (LD), Sequential
Function Charts (SFC) or Structured Text (ST) languages based on IEC 61131 Languages.
In addition, it supports modification function during run, with which an operator may
apply modification during run of a program that is operated in XG-SIM, and it supports
debugging function that trace a user-created program by unit of step.

PLC Lab – Fourth Year Page 2


2) PLC Online function

Besides program monitoring function provided by XG5000, an operator may user online
diagnosis functions such as system monitor, device monitor, trend monitor, data trace
and user event.

3) Module simulation

It also supports simple simulation function for modules mountable on XGK rack type
PLC, such as digital I/O module, A/D conversion module, D/A conversion module, high
speed counter, temperature control module and positioning module. If using the
module simulation function, a program may be simulated by using input values from
module.

4) I/O input condition setup

The value of device may be set with value of specific device or channel value in a
module set as input conditions. Using I/O input condition setup function may realize the
program simulation as created with no PLC program separately created to test a created
PLC program.

PLC Lab – Fourth Year Page 3


Program Editing Steps
1- Launch XG5000 and the program environment is demonstrated as in Fig.1.

Fig.1. XG5000 program environment.

2- Create new project from Project Menu as shown in Fig.2.


3- Fill the editable box with the information concerning the Project name, Project
location, PLC Type, Programming Language, and Project description.
4- From the popup page select the programming language.

PLC Lab – Fourth Year Page 4


Fig.2.Project Menu.

Exercise 01: Draw the Program as show in Fig.3 which performs a simple on/off
switching circuit.

On/Off
Out
IX0.0.0 QX0.0.0

Fig. 3 Ladder Diagram (LD).

PLC Lab – Fourth Year Page 5


Step 1: Opening the workspace environment.

Workspace
environment

Fig.4. Workspace Environment.


Step 2: Insert a normally open contact from the tools menu to the workspace as shown
in Fig.5.

Fig.5. Insert normally open contact to the workspace.

PLC Lab – Fourth Year Page 6


Step 3: Insert a normally open coil from the tools menu to the workspace as shown in
Fig.6.

Fig.6. Insert normally open coil to workspace.


Step 4: Simulate the circuit as shown in Fig.6.

Fig.7. Simulate the circuit.

PLC Lab – Fourth Year Page 7


Step 5: Simulate the On/Off switching circuit by clicking on simulation button in tools
menu as shown in Fig.7

Fig.7: Running simulation results

Exercise 02: Writing the software to the PLC.

Step 1: Establish interfacing between the PC and the PLC as shown in Fig.8.

Fig.8: Connecting PLC to PC.

PLC Lab – Fourth Year Page 8


Step 2: Change the stop mode to the run mode as shown in Fig.9.

Fig.9: Change stop mode to run mode.

Exercise 03: Hardware Implementation.

In this lab, a programmable logic controller is provided in which a program can be


uploaded to the PLC via a USB or RS231 interfacing cable. Figure 10 shows an overview
of the Lab board which is used for training and industrial applications. It has four main
parts i.e. input devices line (switches), input ports, output ports and output devices
(lights). The input devices’ part has 16 switches which can be connected to a selected
input port pin. The input ports’ part has 32 pins starting from I00 to I31 which present
the inputs of the PLC. Similarly, the output ports’ part has 32 pins starting from Q00 to
Q31 which present the outputs of PLC. Finally, the output devices’ part has 10 lights
which can be connected to the output ports to demonstrate the status of the operation
as required based on a program. Ground connection is represented by the Com0 pin
that need to be connected to the -24DCV to supply a power bias to the transistors of
PLC. The main on/off Switches as shown are used to power the board. The wiring of the
Exercise 01 in Fig.3 is shown as in below.

PLC Lab – Fourth Year Page 9


On/OFF Switches

Output Devices
PLC

Output

Input

Input Devices

Fig. 10 Training and application PLC board.

PLC Lab – Fourth Year Page 10


Lab-works:

1. Draw the PLC based solution for the following functions:


a) 𝐹1 = 𝐴. 𝐵 + 𝐶. 𝐷 (3 Marks).

b) 𝐹2 = 𝐴. 𝐵. (𝐶 + 𝐷) (3 Marks).

PLC Lab – Fourth Year Page 11


2. Download and test function (𝐹1 ) on the PLC, then draw your connection
below (2 Marks):

3. Download and test function (𝐹2 ) on the PLC, then draw your connection
below (2 Marks):

PLC Lab – Fourth Year Page 12

You might also like