3.1 Items of the System
3.1.1 PLC
Like for communication via GSM the PLC that we’ll
use will be a S7-200, although once set the
foundations of the system, it can be carried out in
other brands’s PLC by introducing small changes.
3.1.2 Analogical MODEM
The Modem chosen is a module for expansion of S7-
200. It does not need any library and its
configuration is very simple, thanks to the assistant
of the PLC’s programming tool. It works in slave
mode, and it uses MODBUS protocol to
communicate with the PC, which will play a master
role in our supervision system (Jiménez, 2007).
3.1.3 Personal Computer
The master of the system is a PC. This has a Modem
to communicate with the Modem EM241 via the
telephone line. To treat the data being received, a
software application in Visual Basic has been
scheduled, which transforms the MODBUS strings
characters in data that can be displayed in a SCADA
also scheduled in Visual Basic (Janeiro, 2006).
3.2 System Characteristics
3.2.1 Description of Modbus RTU Protocol
Once the connection between the modem local
modem and remote modem connected to the PLC is
established, we must choose a protocol that helps us
to exchange data between the PC (MASTER) and
the PLC that controls our process (SLAVE).
In our case the protocol which we’ll use will be
MODBUS RTU, very used in the industry for
communications via modem.
The controllers communicate by means of a
master-slave technique, in which only one device
(master) may start transactions. The other devices
(slaves) respond by supplying the master the data
requested, or carrying out the action requested in the
petition. Among the master devices typical central
processors and programming panels are included.
Typical slaves are the PLC’s.
3.2.2 The Query-Response Cycle
Query: The function code in the petition indicates
the slave device directing the type of action to
perform. The bytes of data contain any additional
information that the slave will need to carry out the
function. The data field must contain the information
to indicate the slave in what registration it should
begin and how many has to read. The error
verification field provides a method for the slave to
validate the integrity of the contents of the received
message.
Response: If the slave develops a normal response,
the function code content in the response is a replica
of the function code sent in the petition. The bytes of
data contain data collected by the slave, such as
values of registers or states. If an error occurs, the
function code content in the answer is different from
the function code sent in the petition, to indicate that
the answer is a response of error and the bytes of
data contain a code that describes the error. The
verification of error field allows the master to
confirm that the contents of the message are valid.
3.2.3 Queries Implemented by the
Application
Modbus is a protocol developed by Modicon for its
range of PLCs. Siemens, particularly S7-200, has
implemented libraries, which introduced in the
program code, allow to use it. In our case, the
EM241 module has them included, for what it’s not
necessary to modify anything in the PLC’s
programme.
Table 2: Modbus operations implemented by SIEMENS.
FUNCTION DESCRIPTION
1
Read coil status
2
Read input status
3
Read holding registers
4
Read input registers
5
Force single coil
6
Preset single register
15
Force multiple coils
16
Preset multiple registers
Despite that Modbus incorporates a wide variety
of functions, SIEMENS only has 8 implemented
which are those indicated in the table 2.
These operations act on bits in the case of inputs
and outputs, or in words if it is variables in PLC
memory. In the case of desiring to use different
variable sizes, as double words, bits of PLC
memory, etc, it must be done from these functions.
The application which has been developed, has
taken into account this problem and has been
programmed to allow the following requests:
Read and write digital outputs.
Read analogical inputs.
ICINCO 2008 - International Conference on Informatics in Control, Automation and Robotics
84