Sunteți pe pagina 1din 68

Android SCADA platform / Graduation project

2013

Dedication
I dedicate this work as a token of my deep respect, my great love and gratitude to: My dear parents, All members of my family, And all my friends.

Acknowledgement

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

It is with great pleasure that I would first like to express my gratitude to my dear supervisor in
2013

both institutions ESPRIT and Millnia engineering: Mr Imed Ouardi, Ms Sana Ben Fadhel and Mr Houssem Eddine Lassoued for the attention they have given to my project throughout its various stages from concept to completion and these valuable tips. I want also to thank all the team members (ESPRIT MOBILE) among them M.Wael, M Imed Amri and the same for M.Bechir Messabeb who was a great help for me in Millinia engineering for support and encouragement. I am indebted to all my teachers for their efforts that have guided my steps throughout my university studies; I take the same opportunity to thank Mr. Karim MAGHREBI language for His help.

I finally want to express honor to the jury members for agreeing to lend me their attention and evaluate my work.
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

Table des matires


TABLE DES MATIRES.........................................................................................................3 LISTE DES TABLEAUX..........................................................................................................7 TABLE DES MATIRES.........................................................................................................8 GENERAL INTRODUCTION.................................................................................................9 GENERAL CONTEXT...........................................................................................................10
I-General Context..........................................................................................10 1-Project context............................................................................................................ 10 2-Introducing the Host company ...................................................................................10 3-Project issues.............................................................................................................. 10 4-Proposed Solution....................................................................................................... 10 Conclusion...................................................................................................................... 10

2013

1.GENERAL CONTEXT. ......................................................................................................11


I-General Context..........................................................................................11 1-Project context............................................................................................................ 11 2-Introducing the Host company ...................................................................................11 3-Project issues.............................................................................................................. 12 4-Proposed Solution....................................................................................................... 13 Conclusion...................................................................................................................... 13 I-Mobile application......................................................................................15 II-Medium and Protocols................................................................................15

STATE OF ART .....................................................................................................................15 2.STATE OF ART ..................................................................................................................16


I-Mobile application......................................................................................16 1-Overview..................................................................................................................... 16 2-Android Platform......................................................................................................... 16 3-Highlights.................................................................................................................... 17 4-Weakness.................................................................................................................... 17 II-Medium and Protocols ...............................................................................18 1-Why Ethernet? Why TCP/IP?........................................................................................18

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project


2-MODBUS Protocol ...................................................................................................... 20 a- EtherNet/IP................................................................................................................. 21 b- PROFINET.................................................................................................................. 21 Managed by PROFIBUS and PROFINET International (PI), PROFINET is an application protocol that uses familiar concepts from PROFIBUS that are implemented on the physical layer of Ethernet. PROFINET is adopted by SIEMENS........................................21 c- EtherCAT................................................................................................................... 22 EtherCAT (Ethernet for Control Automation Technology) is a high-performance, industrial communication protocol for deterministic Ethernet. Published as part of IEC 61158, this open standard implements a master and slave architecture over standard Ethernet cabling to transfer data with predictable timing and precise synchronization. EtherCAT is adopted by BECKHOFF................................................................................22 3-MODBUS: Protocol of Choice.......................................................................22 a-Definition.................................................................................................................... 22 b-Services supported by Modbus...................................................................................22 c-Principle of Modbus exchanges...................................................................................23 d-MODBUS Addressing model........................................................................................24 4-RTU Modbus Protocol.................................................................................25 5-Modbus ASCII Protocol...............................................................................26 6-Modbus TCP/IP........................................................................................... 26 a-Structure of a Modbus TCP/IP message.......................................................................27

2013

III-SCADA SYSTEM..............................................................................................................29
....................................................................................................................................... 29 1-What is SCADA?.......................................................................................................... 29 2-Components of SCADA System...................................................................................29 Field Instrumentation refers to the devices that are connected to the equipment or machines being controlled and monitored by the SCADA system. These are sensors for monitoring certain parameters; and actuators for controlling certain modules of the system........................................................................................................................... 30 These instruments convert physical parameters (i.e., fluid flow, velocity, fluid level, etc.) to electrical signals (i.e. voltage or current) readable by the Remote Station equipment. Outputs can either be in analog (continuous range) or in digital (discrete values). Some of the industry standard analog outputs of these sensors are 0 to 5 volts, 0 to 10 volts, 4 to 20 mA and 0 to 20 mA. The voltage outputs are used when the sensors are installed near the controllers (RTU or PLC). The current outputs are used when the sensors are located far from the controllers...................................................30 Likewise, digital and analog inputs are used for control. For example, digital inputs can be used to turn on and off modules on equipment. While analog inputs are used to control the speed of a motor or the position of a motorized valve.................................30 Field instrumentation connected to the plant or equipment being monitored and controlled are interfaced to the Remote Station to allow process manipulation at a remote site. It is also used to gather data from the equipment and transfer them to the central SCADA system. The Remote Station may either be an RTU (Remote Terminal Unit) or a PLC (Programmable Logic Controller). It may also be a single board or modular unit................................................................................................................... 30 The Communication Network refers to the communication equipment needed to transfer data to and from different sites. The medium used can either be cable,

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project


telephone or radio. The use of cable is usually implemented in a factory. This is not practical for systems covering large geographical areas because of the high cost of the cables, conduits and the extensive labor in installing them. The use of radio offers an economical solution. Radio modems are used to connect the remote sites to the host. An on-line operation can also be implemented on the radio system. For locations wherein a direct radio link cannot be established, a radio repeater is used to link these sites............................................................................................................................... 31 The Central Monitoring Station (CMS) is the master unit of the SCADA system. It is in charge of collecting information gathered by the remote stations and of generating necessary action for any event detected. The CMS can have a single computer configuration or it can be networked to workstations to allow sharing of information from the SCADA system.................................................................................................31 ..................................................................................................................................... 32 There are many major companies who offer different SCADA system solutions mentioning some of them for example: Wonderware, Intellution, Rockwell Software, Siemens, and ABBGenerally the solutions made by these companies are complex, Ramified, made for a huge project and most of all very much costly.............................32 For the Android SCADA solutions there are none, at least as available solutions, and if there are its only for monitoring and supervision, that means just an Android application which is connected with the CMS (Central Monitoring Station) and offers to the user a real-time visualization, a GUI (graphical user interface). As an example for such type of solutions we can mention TeslaScada who developed applications that can offer communication between an android device and industrial automation applications and visualization............................................................................................................ 32 As was mentioned before a SCADA system contains four components: field instrumentation, communication network, remote station and the central monitoring station. The two first parts are hardware equipment and cant be replaced but the two last are basically a software solution and there our project starts.................................33 So the idea was to create a solution which is an Android application able to communicate with the field instrumentation, collect data, saved to a data-base and present it on the screen.................................................................................................33 Conclusion...................................................................................................................... 33 Modbus is a messaging protocol uses application layer that provides client / server communication between devices connected to different networks, this is what we were talking the most in this chapter, plus the concept of SCADA in general.........................33 Specification and functional analysis..............................................................................34

2013

3.SPECIFICATION AND FUNCTIONAL ANALYSIS......................................................35


1-Agile Methodologies.................................................................................................... 40 2-Mobile-D: A methodology for the development of mobile applications........................41 A-Mobile-D introduction................................................................................41 B-Why Mobile-D for mobile application?.........................................................42 C-Mobile-D in phases.....................................................................................43 D-Mobile-D methodology evaluation..............................................................45 Advantages.................................................................................................................... 45 Disadvantages............................................................................................................... 47 Design Phase.................................................................................................................. 48

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

4.DESIGN PHASE ..................................................................................................................49


Implementation.............................................................................................................. 54

5.IMPLEMENTATION .........................................................................................................55 LIST OF ABBREVIATIONS.................................................................................................60 BIBLIOGRAPHIE ..................................................................................................................61 ANNEX.....................................................................................................................................61


Read Coils 01 (0x01) ..................................................................................................... 63 Read Discrete Inputs 02 (0x02)......................................................................................63 Read Holding Registers 03 (0x03)..................................................................................64 Read Input Registers 04 (0x04)......................................................................................65 Write Single Coil 05 (0x05).............................................................................................66 Write Single Register 06 (0x06).....................................................................................66 Write Multiple registers 16 (0x10)..................................................................................67

2013

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Liste des tableaux TABLE 1: GENERAL FEATURES OF SOME OF AGILE SOFTWARE DEVELOPMENT METHODS.......................................................................................1 TABLE 2: MOBILE-D AND MOBILE SOFTWARE DEVELOPMENT CHARACTERISTICS ......................................................................................................4 TABLE 3: DESCRIPTION OF THE USE CASE CONSULT THE COLLECTED DATA.........................................................................................................4 TABLE 4: DESCRIPTION OF THE USE CASE RETRIEVE THE DEVICE STATE..................................................................................................................4

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Table des matires


2013

FIGURE 1: .................................................................................................................................4 FIGURE2: MOBILE-D...............................................................................................................4 FIGURE3: MOBILE-D PHASES...............................................................................................4 FIGURE4: ANNUAL GROWTH OF INDUSTRIAL ETHERNET INFRASTRUCTURE.................................................................................................................4 FIGURE5: CONSTRUCTION OF A TCP/IP-ETHERNET DATA PACKET..........................4 FIGURE6: INDUSTRIAL ETHERNET PROTOCOLS MARKET SHARE............................4 FIGURE7: PUBLIC FUNCTION CODE DEFINITION...........................................................4 FIGURE8: COMMUNICATION ENTER MASTER AND SLAVE.........................................4 FIGURE9: MODBUS ADDRESSING MODEL.......................................................................4 FIGURE10: RTU MODBUS FRAME STRUCTURE...............................................................4 FIGURE11: ASCII MODBUS FRAME STRUCTURE............................................................4 FIGURE12: MANAGING A MODBUS TCP/IP CONNECTION............................................4 FIGURE13: CONSTRUCTION OF A MODBUS TCP DATA PACKET................................4 FIGURE14: READ COILS STATE DIAGRAM.......................................................................4 FIGURE15: GLOBAL USE CASE DIAGRAM........................................................................4 FIGURE16: SEQUENCE DIAGRAM WITHOUT HUMAN INTERACTION....................4 FIGURE17: OBJECTS SEQUENCE DIAGRAM.....................................................................4 FIGURE18: ACTIVITY DIAGRAM.........................................................................................4 FIGURE19: CLASS DIAGRAM................................................................................................4 FIGURE20: THE SHAPE OF THE USED DEVICE.................................................................4 FIGURE21: MODBUS SLAVE INTERFACE..........................................................................4 FIGURE22: WIRESHARK INTERFACE.................................................................................4

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

General Introduction
2013

Android has become increasingly interesting for hardware development. Now, we should soon be able to connect joysticks, custom hardware, sensors and other devices and make a platform Android almost in every field and among those fields we can find the industrial field. New API Management hardware enables everyone to develop hardware accessories for Android, from individual amateurs to major global brands. You do not have to sign an NDA, and you do not need a special license material, the aspects concerning Apple's policy does not exist in Android. We have always been able to connect an Android device to a computer, but until a while ago, there was no way for Android applications to interact with other hardware via Ethernet or any other port. In this context, we explore new support for input output devices, as well as new opportunities for applications to communicate with devices via Ethernet and by using TCP / IP protocol. Among the many fields that can interact with Android there is the industrial field. Indeed, this interaction is more or less new, as seeking we couldnt find enough tests and experiments that concern this meeting. We had the courage to involve in this project and dive into this experience. It is in this context that our project is: it is study, design, develop an embedded intelligent system based on Android. Throughout this report, we will discuss the different stages of our project, starting with a presentation of the basic concepts in the understanding of our subject, then we present the various existing solutions and finally in the last section, we shall a detailed description of the formulated solution.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Chapter I

General context

Introduction IGeneral Context

1- Project context 2- Introducing the Host company 3- Project issues 4- Proposed Solution Conclusion

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

1.General context.
Introduction We present in this chapter a preliminary study of the project. At first, we present the environment of the internship. Subsequently, we describe the problem and the main objectives of the project. IGeneral Context
2013

1- Project context

As part of the education of Telecommunications engineers in (ESPRIT), we had the opportunity to do our end of studies project for the National Diploma in Telecommunications Engineering at Millinia engineering and with ESPRIT Mobile team at ESPRIT, usually the project is intended to complement our academic training acquired during the last three years, and bring us into professional life through implementation of our knowledge, use of acquired skills and to test our mind engineer. The project is to design and implement an application based Android on system in order to switch to the open-source programming and to reduce costs.
2- Introducing the Host company

Millenia Engineering is a limited company (Ltd) working in partnership with renowned manufacturers. Its initial objective is to offer a national and international clients outsourcing tasks and design studies in the fields of electronics and telecommunications to make some projects feasible design of new products. These tasks require, particularly in Europe, a major investment behind which stands as a major obstacle to the achievement. Millenia Engineering has several projects in various fields of activities. It has worked in the design and development of IT solutions for the industry. Furthermore, Millenia Engineering has several other activities in Tunisia and
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

around the world in partnership with major companies for the implementation of systems with high technological added value in the field of BMS (building management system). Millenia participated in collaboration with Tunisian research centers (Sup'Com, ENIT ...) in several pilot projects. These observations made, the activity of Millenia Engineering covers four main areas: - Electronic communications: communication, signal processing, wireless connections ... - Instrumentation. - Computer peripheral. - General public (Consumer Electronics).
3- Project issues
2013

To achieve an embedded intelligent system based on Android and that meets the needs requested by Millinia-Engineering and different potential clients (companies, people), it is important to focus primarily on the issues of the project in order to be organized. Thus, we will determine the scope of action and the feasibility of this project. The project involves multiple environments; it starts on the developer's machine, through a phase of communication with some devices, to the actual testing environment to finally arrive at the surround production. In addition, the project can be transferred from one environment to another several times before it is finalized. In this project, the provision of an environment with another does not happen the same way that you work with a single environment, and do not present the same degree of complexity, as in a development environment, a simple compilation is enough, and even errors can be detected, but the deployment of the solution on the other environments especially communication
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

with industrial equipment has several constraints and challenges more if we want to transfer only a very specific functionality, without affecting other features, that makes this difficult and painful hence the need to develop an approach to achieve this task manipulation. There are also other scenarios the system can force us to design a flexible solution such as: System that meets the specific needs in terms of functionality. System System that meets specific has a needs margin in terms large of personalization. scalability
2013

which

enough

Demonstrate the ability to merge the intelligence of Android with industrial environment.
4- Proposed Solution

The solution proposed as an embedded intelligent system based on Android OS solution is a SCADA platform based on Android, it operates on two levels, the first will have the role of ensuring the communication and the interaction with the external environment represented in different external devices, the second level allows the user to interact with the application by providing a GUI which offers several advanced features.
Conclusion

This chapter has served us to put our project in its frame. Indeed, our graduation project is made in Millinia-Engineering, which is to create an application based on Android which communicates with an industrial environment, in order to monitor and increase technological innovation in the both fields. In the next chapter we introduce the necessary concepts that lead to understand this project: an overview of the chosen solution as a concept and as a platform
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

for software development and other existing solutions and a comparison of these solutions to focus on their strengths and weaknesses.
2013

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Chapter II

State of Art

Introduction IIIMobile application Medium and Protocols

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2.State of Art
2013

Introduction In this chapter we will present some concepts and technologies that will be used to better understand our subject, this chapter is divided into three parts which are as follows. The first part will be devoted to the presentation of the concept and principle of the mobile application and the, the second part we will talk deeply the MODBUS protocol, causes of choice, the areas of activity, operation mode and the different modes of use, and in the end we will be talking about the SCADA concept and the new challenges with a comparative study of similar products on the market.

I-

Mobile application

1- Overview

A mobile application is a downloadable program on a free of charge, or paid, or executable, from the operation system of the phone or other device, and is specific for mobile operating system and developed by unique and specific language required with the publishers offered by the company that provides the system and offers some tools to application development.
2- Android Platform

Android is an open source Linux-based operating system designed primarily for touch screen mobile devices such as smart phones and tablet computers. Initially developed by Android, Inc., which Google backed financially and later bought in 2005, This open-source code and permissive
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers
2013

The open-source code as a foundation for community-driven projects, which add new features for advanced users or bring Android to devices which were officially released running other operating systems.
3- Highlights Security: Android OS is proven to have superior security when

compared to other mobile phone operating systems. One of the factors that contribute to the improved security that Android OS has is the fact that all apps require authorization in order to access the various phone resources such as memory, installation and network.

Rich

multimedia

capabilities:

Android

OSs

multimedia

capabilities range from media transfer to multimedia streaming. Android users also get to enjoy other benefits such as Multilanguage support, tethering, massive external storage capability and multitasking among others.

Easy to operate: Many users appreciate devices that are easy to

operate. Android OS is highly preferred due to its simplicity in operation. Besides being easy to operate, this operating system is less prone to crashing, which makes it very convenient to both first-time and experienced users to access applications without any worries.
4- Weakness

Fragmentation: Android OS has several versions, devices running

Android comes in many shapes and sizes, available in different screen sizes and rated in vast numbers of different performance levels. All these factors contributed to the growing fragmentation of Android OS which burden developers to optimize apps according to each category. It was extremely challenging and time consuming.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Battery Drainage and overheating: Overheating of Android Internet connection: Most Android devices require a simultaneous

device has been a big issue and it has a very short battery life.

2013

Internet connection

II-

Medium and Protocols

1- Why Ethernet? Why TCP/IP?

No doubt, Ethernet and the TCP/IP Protocol are achieving more and more acceptance in the industrial automation technology. Major technical advances such as Fast Ethernet, Switching and Full Duplex communication have turned the good old Ethernet into a powerful communication system with a magical attraction to industrial users and manufacturers. a_ Ethernet A 2004 report measured the industrial Ethernet infrastructure market at $124 million. This latest study finds the market grew to more than $260 million in 2006, and will continue to increase 29% annually, reaching $995 million in 2011.

Figure4: Annual growth of industrial Ethernet infrastructure

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Although Ethernet has secured a growing share of the global automation networking market, researches confirm that numerous other types of industrial networks have also been expanding over the last several years. Ultimately, some of the applications now served by the many industrial device networks and motion control networks will migrate to industrial Ethernet. Ethernet has several advantages:

2013

Greater bandwidth and larger data packages for communications Connecting and addressing more devices over wider areas. Quicker Real-Time communication with synchronization good

with more and more intelligent industrial devices.

enough even for demanding motion control applications.

Integration to the office world, IT-functions, Internet/Intranet,

remote configuration. This is basically TCP/IP on Ethernet with application protocols such as SNMP, FTP, MIME, HTTP. Communications over routers and servers where IP-addressing and TCP transport are mandatory. b_ TCP/IP Protocols TCP/IP refers to the Transmission Control Protocol and Internet Protocol which were first introduced in 1974. TCP/IP is the foundation for the World Wide Web and forms the transport and network layer protocol of the internet that commonly links all Ethernet installations world-wide. Simply stated, TCP/IP allows blocks of binary data to be exchanged between computers. The primary function of TCP is to ensure that all packets of data are received correctly, while IP makes sure that messages are correctly addressed and routed. TCP/IP does not define what the data means or how the data is to be interpreted; it is merely a transport protocol.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure5: PACKET

CONSTRUCTION

OF

TCP/IP-ETHERNET

DATA

Ethernet communication with TCP/IP is non-deterministic and the reaction time is often above 100ms. Remote I/O demands reaction in the 5-10ms regions. Motion Control craves even higher demands determinism with cycle times into the microsecond region. The conflict between IT-traffic using TCP/IP and the achievement of real-time performance is dealt with in several different ways. By using standard TCP/IP embedding a field bus protocol at the application level maintains full IT-openness. You just tunnel the field bus protocol on Ethernet. Reaction time is around 100ms like standard Ethernet. In local segments with few devices and small data packages the reaction time goes down to 20ms. By using UDP instead of TCP the reaction time comes down to 10ms at best. Direct MAC-addressing in a local segment can bring reduce this closer to 1ms. Time synchronization can be added such as that obtained by applying IEC61588. Bandwidth for TCP/IP traffic remains at 90-100%.

2- MODBUS Protocol

Major industrial Ethernet protocols


5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

Industrial Ethernet protocols offer many varieties for high speeds, target applications, determinism, and compatibility with standard Ethernet. Each technology has its benefits and limitations, and the best choice often depends on the specific requirements of the system. To provide high-performance measurements and real-time control, National Instruments products can easily plug into the most popular industrial Ethernet protocols. In his report "The world market for industrial Ethernet", the market research firm IMS Research has established a classification protocol Ethernet equipment sales, and the result appears in the figure below.
2013

Figure6: Industrial Ethernet protocols Market share


a- EtherNet/IP

Developed by Rockwell Automation and managed by the Open DeviceNet Vendors Association (ODVA), EtherNet/IP extends the common industrial protocol (CIP) of DeviceNet to Ethernet. EtherNet/IP is an application layer protocol that uses TCP for general messages and user datagram protocol (UDP) for I/O messaging and control. UDP is a multicast protocol that routes packets from the controller to multiple destinations.
b- PROFINET

Managed by PROFIBUS and PROFINET International (PI), PROFINET is an application protocol that uses familiar concepts from PROFIBUS that are
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

implemented on the physical layer of Ethernet. PROFINET is adopted by SIEMENS.


2013

c- EtherCAT

EtherCAT (Ethernet for Control Automation Technology) is a highperformance, industrial communication protocol for deterministic Ethernet. Published as part of IEC 61158, this open standard implements a master and slave architecture over standard Ethernet cabling to transfer data with predictable timing and precise synchronization. EtherCAT is adopted by BECKHOFF. 3- MODBUS: Protocol of Choice
a- Definition

The Modbus protocol was developed in 1979 by Modicon, Incorporated, for industrial automation systems and Modicon programmable controllers. It has since become an industry standard method for the transfer of discrete/ analog I/O information and register data between industrial control and monitoring devices. Modbus is now a widely-accepted, open, public-domain protocol that requires a license, but does not require royalty payment to its owner. MODBUS is an application layer messaging protocol, positioned at level 7 of the OSI model that provides client/server communication between devices connected on different types of buses or networks. The Internet community can access MODBUS at a reserved system port 502 on the TCP/IP stack.
b- Services supported by Modbus

The Modbus protocol provides 19 different functions. They are characterized by a function code (in hexadecimal). The different function codes are detailed in the table below.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure7: Public Function Code Definition


c- Principle of Modbus exchanges

Modbus devices communicate using a master-slave (client-server) technique in which only one device (the master/client) can initiate transactions (called queries). The other devices (slaves/servers) respond by supplying the requested data to the master, or by taking the action requested in the query. A slave is any peripheral device (I/O transducer, valve, network drive, or other measuring device) which processes information and sends its output to the master using Modbus. The Acromag I/O Modules form slave/server devices, while a typical master device is a host computer running appropriate application software. Other devices may function as both clients (masters) and servers (slaves).

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure8: Communication enter Master and Slave Masters can address individual slaves, or can initiate a broadcast message to all slaves. Slaves return a response to all queries addressed to them individually, but do not respond to broadcast queries. Slaves do not initiate messages on their own, they only respond to queries from the master.
d- MODBUS Addressing model

The address of each subscriber is independent of its physical location. It ranges from 1 to 64 and must not be assigned sequentially. Subscribers are required to have different addresses. In a MODBUS PDU each data is addressed from 0 to 65535. It also defines clearly a MODBUS data model composed of 4 blocks that comprises several elements numbered from 1 to n.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure9: Modbus addressing model

4- RTU Modbus Protocol When using the RTU Modbus protocol, the communication message structure is as follows:

Figure10: RTU Modbus frame structure -The address field contains the address of the slave instrument to which the message is being sent. In theory, one can connect up to a maximum of 245 apparatuses (slaves). -The Function field contains the function ID that has to be carried out by the slave. - The Data field contains the data sent to the slave or the data sent by the slave as a response to a question.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

-The CRC field permits both the master and slave to check whether there are transmission errors.
2013

5- Modbus ASCII Protocol The Modbus ASCII protocol is normally used in applications that need to communicate via modem. The functions and addresses available are the same as the RTU version, but the characters transmitted are in ASCII and the termination of the message is not done via the time but with return characters. The structure of the communication message structure is as follows:

Figure11: ASCII Modbus frame structure -The address field contains the address of the slave instrument to which the message is being sent. - The Function field contains the function ID that has to be carried out by the slave. - The Data field contains the data sent to the slave or the data sent by the slave as an answer to a question. The maximum length allowed is 32 consecutive registers. - The LRC field permits both the master and slave to check whether there are transmission errors.

6- Modbus TCP/IP Modbus TCP/IP (also Modbus-TCP) is simply the Modbus RTU protocol with a TCP interface that runs on Ethernet. The Modbus messaging structure is the application protocol that defines the rules for organizing and interpreting the data independent of the data transmission medium.
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

TCP/IP refers to the Transmission Control Protocol and Internet Protocol, which provides the transmission medium for Modbus TCP/IP messaging. Simply stated, TCP/IP allows blocks of binary data to be exchanged between computers. The primary function of TCP is to ensure that all packets of data are received correctly, while IP makes sure that messages are correctly addressed and routed. Note that the TCP/IP combination is merely a transport protocol, and does not define what the data means or how the data is to be interpreted (this is the job of the application protocol, Modbus in this case).
2013

Figure12: Managing a Modbus TCP/IP connection

a- Structure of a Modbus TCP/IP message

Modbus TCP/IP uses TCP/IP and Ethernet to carry the data of the Modbus message structure between compatible devices. That is, Modbus TCP/IP combines a physical network (Ethernet), with a networking standard (TCP/IP), and a standard method of representing data (Modbus as the application protocol). In practice, Modbus TCP embeds a standard Modbus data frame into a TCP frame, without the Modbus checksum, as shown in the following diagram.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure13: CONSTRUCTION OF A MODBUS TCP DATA PACKET

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

III- SCADA system


2013

1- What is SCADA?

SCADA (Supervisory Control And Data Acquisition) system refers to the combination of telemetry and data acquisition. It consists of collecting information, transferring it back to a central site, carrying out necessary analysis and control, and then displaying this data on a number of operator screens. The SCADA system is used to monitor and control a plant or equipment. Control may be automatic or can be initiated by operator commands. SCADA systems were first used in the 1960s. SCADA stands for supervisory control and data acquisition. It generally refers to an industrial control system: a computer system monitoring and controlling a process. The process can be industrial, infrastructure or facilitybased as described below: Industrial processes include those of manufacturing, production,

power generation, fabrication, and refining, and may run in continuous, batch, repetitive, or discrete modes. Infrastructure processes may be public or private, and include water

treatment and distribution, wastewater collection and treatment, oil and gas pipelines, electrical power transmission and distribution, Wind Farms, civil defense siren systems, and large communication systems. Facility processes occur both in public facilities and private ones,

including buildings, airports, ships, and space stations. They monitor and control HVAC, access, and energy consumption.
2- Components of SCADA System
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

i-

Field Instrumentation Field Instrumentation refers to the devices that are connected to the
2013

equipment or machines being controlled and monitored by the SCADA system. These are sensors for monitoring certain parameters; and actuators for controlling certain modules of the system. These instruments convert physical parameters (i.e., fluid flow, velocity, fluid level, etc.) to electrical signals (i.e. voltage or current) readable by the Remote Station equipment. Outputs can either be in analog (continuous range) or in digital (discrete values). Some of the industry standard analog outputs of these sensors are 0 to 5 volts, 0 to 10 volts, 4 to 20 mA and 0 to 20 mA. The voltage outputs are used when the sensors are installed near the controllers (RTU or PLC). The current outputs are used when the sensors are located far from the controllers. Likewise, digital and analog inputs are used for control. For example, digital inputs can be used to turn on and off modules on equipment. While analog inputs are used to control the speed of a motor or the position of a motorized valve.

ii-

Remote Station Field instrumentation connected to the plant or equipment being

monitored and controlled are interfaced to the Remote Station to allow process manipulation at a remote site. It is also used to gather data from the equipment and transfer them to the central SCADA system. The Remote Station may either be an RTU (Remote Terminal Unit) or a PLC (Programmable Logic Controller). It may also be a single board or modular unit.
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

iii-

Communication Network The Communication Network refers to the communication equipment

2013

needed to transfer data to and from different sites. The medium used can either be cable, telephone or radio. The use of cable is usually implemented in a factory. This is not practical for systems covering large geographical areas because of the high cost of the cables, conduits and the extensive labor in installing them. The use of radio offers an economical solution. Radio modems are used to connect the remote sites to the host. An on-line operation can also be implemented on the radio system. For locations wherein a direct radio link cannot be established, a radio repeater is used to link these sites.

iv-

Central Monitoring Station (CMS) The Central Monitoring Station (CMS) is the master unit of the SCADA

system. It is in charge of collecting information gathered by the remote stations and of generating necessary action for any event detected. The CMS can have a single computer configuration or it can be networked to workstations to allow sharing of information from the SCADA system. A Man-Machine Interface (MMI) or Human Machine Interface (HMI) program will be running on the CMS computer. A mimic diagram of the whole plant or process can be displayed onscreen for easier identification with the real system. Each I/O point of the remote units can be displayed with corresponding graphical representation and the present I/O reading. The flow reading can be displayed on a graphical representation of a flow meter. A reservoir can be displayed with the corresponding fluid contents depending on the actual tank level. Set-up parameters such as trip values, limits, etc. are entered on this
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

program and downloaded to the corresponding remote units for updating of their operating parameters. The MMI program can also create a separate window for alarms. The alarm window can display the alarm tag name, description, value, trip point value, time, date and other pertinent information. All alarms will be saved on a separate file for later review. A trending of required points can be programmed on the system. Trending graphs can be viewed or printed at a later time. Generation of management reports can also be scheduled on for a specific time of day, on a periodic basis, upon operator request, or event initiated alarms.
2013

v-

Overview of Existing Solutions

There are many major companies who offer different SCADA system solutions mentioning some of them for example: Wonderware, Intellution, Rockwell Software, Siemens, and ABBGenerally the solutions made by these companies are complex, Ramified, made for a huge project and most of all very much costly. For the Android SCADA solutions there are none, at least as available solutions, and if there are its only for monitoring and supervision, that means just an Android application which is connected with the CMS (Central Monitoring Station) and offers to the user a real-time visualization, a GUI (graphical user interface). As an example for such type of solutions we can mention TeslaScada who developed applications that can offer communication
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

between an android device and industrial automation applications and visualization.


2013

vi-

Choice of solution As was mentioned before a SCADA system contains four components:

field instrumentation, communication network, remote station and the central monitoring station. The two first parts are hardware equipment and cant be replaced but the two last are basically a software solution and there our project starts. So the idea was to create a solution which is an Android application able to communicate with the field instrumentation, collect data, saved to a data-base and present it on the screen. Conclusion Modbus is a messaging protocol uses application layer that provides client / server communication between devices connected to different networks, this is what we were talking the most in this chapter, plus the concept of SCADA in general.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Chapter III Specification and functional


analysis

2013

Introduction IIIIIIIVFunctional Specification Use case diagrams Sequence diagram Methodology of development

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

3.Specification and functional analysis


Introduction This chapter specifies characteristics of our project, consisting of the mobile application. The first section will be an overall description of the application. In the second part we will detail the system-required features. The third part aims to specify some nonfunctional requirements. Then we will present some use case and sequence diagrams.

2013

I-

Functional Specification

1- Overall application description

This application answers to a number of required specificities, encompassing real-time data delivery and communication between industrial devices and the Android device. Usage is generally encouraged through the mass collaboration phenomenon; the more data there is, the more often the system should collected and save it to send later.

2- Functional system requirements

Our application has to fulfill a number of requisites in order to satisfy the users needs. Communicate with the industrial device: the first and one the main

requirements in our project is to make our Android device able to communicate with the industrial device by using the adequate frame with the Modbus protocol,
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

and that can be achieved when the other device respond and send back an acknowledgment message.

Collect the data: The Android device must receive back the

2013

demanded information within a Modbus frame and extract the suitable information.

Saving collected data: The application has the role to save the

received information into a local database and add every time some details that may be useful later.

Send information via internet: The application has the role to send

the suitable information to a predefined Google-Cloud account via internet network by using the 3G technology.

Display information: A local user would be able to visualize the

collected data on the device screen by choosing to show a table or a graphical line chart.

Retrieve the devices state: The local user would be capable to

visualize the Android device connectivity which is the 3G internet connection and the Ethernet connection between the Android device and the industrial device.

3- Nonfunctional requirements

In addition to the functional requirements developed above, we must take into account the following constraints: The application must be effective and must ensure continuity of It must meet the physical capabilities of devices equipped with the It should be compatible with the versions above the API 3.0 It must be compatible with the different screen resolutions.
5 2

operation.

Android OS.

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

The response time of the whole system must be acceptable for use in The design of the application must be attractive, understandable,

real time; the system must be secure and stable.

2013

clear, easy to handle and respect the usual ergonomics distributed applications.

II-

Use case diagrams

1- Global use case diagram

The user, having already login in to the application can check the devices stat of network connection or to the industrial component, he can also consult the collected data by visualizing a line chart or just consult database table; on the other side the user can check the critical collected data by consulting any device has an internet access.

Figure15: Global Use Case Diagram

2- Textual description of the use case diagram

This section will be devoted to the presentation of the main use cases. i. Use case Consult the collected data
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

This diagram shows the different aspects of what we call consult collected data, which we present in this table: Use case name Actors Short description Pre-conditions Post-conditions Main flow Consult the collected data User The user will access the application and retrieve the collected information Authentication accepted N/A -The user accesses the application -The user can choose between consult the whole saved data from a table or just visualize the last information in a chart -The system displays the desired choice Alternate flow An error in the database Exception flow N/A Table 3: Description of the use case Consult the collected data ii. Use case- Retrieve the device state This diagram shows the different aspects of what we call retrieve the device state, which we present in this table: Use case name Actors Short description Pre-conditions Post-conditions Main flow Retrieve the device state User The user will access the application and check the state of his device Authentication accepted N/A -The user accesses the application -The user will be able to visualize in the main screen the state of internet connectivity and the Alternate flow state of Ethernet connection. N/A
5 2
2013

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

Exception flow N/A Table 4: Description of the use case Retrieve the device state
2013

III-

Sequence diagram

1- System sequence diagram

Figure16: Sequence diagram without human interaction


2- Description

This diagram shows the interaction sequentially between the system and other actors. So as a start the application will start communication to the industrial device by sending a request frame asking for the device state or some registers values, this device will respond by sending back the demanded data in hexadecimal format, so the application will convert it into decimal then extract the wanted value and saved into the local database (SQLITE D.B). In case of attempting a critical value predefined by developer the system will convert the last database file to an excel or text file and then will ask
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

the Google-Drive platform for the authentication, once it is agreed the system will send him this file, an acknowledgment will be received. This diagram shows also the interaction sequentially between the actor and the system. So the user will start using the application he will have to enter the correct predefined password, once access agreed the user will find himself in the main screen where he will have the ability to check the state of systems connectivity (internet and Ethernet), also he will be able to visualize the last collected data in a line chart graph or just read the values from a table. Both operations require communication between the system and his Data-Base. IVMethodology of development
2013

1- Agile Methodologies

The "agile methods" are designed to reduce the software lifecycles by first developing a minimum version, then integrating the functions through an iterative process based on consumers feedback and tests performed throughout the development cycle. The origin of agile methods is related to the instability of the technological environment and the fact that customers are often unable to define their needs comprehensively from the beginning of the project. The term "agile" is referring to the ability to adapt to context switches and changes in specifications during the intervening development process. In 2001, 17 people started and developed the Agile Manifesto whose translation is as follows:

Individuals and interactions rather than processes and tools. Software development rather than exhaustive documentation. Collaboration with the client rather than contract negotiation. Openness to change rather than following a rigid plan.

With agile methods, the client is the full driver of his project and reaps the result of his software relatively quickly.
5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

2013

Table 1: General features of some of agile software development methods


2- Mobile-D: A methodology for the development of mobile applications

A-Mobile-D introduction While many agile methods have been presented, none of them is specifically tailored for the development of mobile software. Mobile-D is an agile approach for mobile equipment, based on Extreme Programming XP (practice), Crystal methodology (scalability) and Rational Unified Process (lifecycle insurance). It is designed for the specific development of the mobile application and the quality standards of the industry. The ideal case is to have less than ten developers working in an office. The directors aim to provide a fully functional incremental mobile application in several iterations. The development work is divided into phases, i.e. exploration, initialize, productionize, stabilize, and test and set system.
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

In practice, each phase consists of nine major elements: phase and stage, online architecture, mobile test-driven development, continuous integration, pair programming, metrics, process improvement software agile, customer off-site, and concentration of the User-Centered.
2013

B- Why Mobile-D for mobile application?

Figure 1 By combining the benefits of the three agile methods, XP in terms of practices, Crystal family of methodologies in terms of scalability and Rational Unified Process in the terms of life-cycle coverage , Mobile-D meets the requirements for the development of mobile application. The table below shows that Mobile-D is suitable for mobile application development.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Table 2: Mobile-D and mobile software development characteristics

C- Mobile-D in phases

Figure2: Mobile-D

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

The Mobile-D process goes through 5 principle phases:

Explore

2013

The purpose of the Explore phase is the planning and establishment of the incipient project. A well planned deed is half done is a saying to be also remembered in the software development context. The explore phase can be timely unattached to the previous phases of Mobile-D and also overlap with the 0 Iteration phase. It is important for setting the grounds for controlled implementation of the software development product, especially pertaining to issues related to product architecture, software development process and environment selection. Different stakeholder groups are needed to provide their expertise in this critical step.

Initialize

The purpose of this phase pattern is to enable the success of forthcoming project phases by preparing and verifying all critical development issues. In the end, all are in full readiness for implementing options selected by the customer.

Productionize

At the production phase, the required functionality is put together in the product by applying an iterative and incremental development cycle.

Stabilize

The purpose of the Stabilize phase pattern is to ensure projects implementation quality.

System test & fix

The System Test & Fix aims at controlling the produced systems performances. This is achieved by verifying the correct implementation of customer defined functionality, providing the project team continuous feedback on the systems functionality, and fixing the found defects.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure3: Mobile-D phases

D-Mobile-D methodology evaluation The mobile-D methodology advantages and disadvantages are listed below.
Advantages Mobile-D is well adapted to mobile software development in small

teams.

Able to satisfy the changing needs of users through short iterations

(phases initialize productionize, stabilize).

Pair programming for each iteration working day step, is very

efficient.

Software documentation is complete. Every step is clear and detailed. Easy to monitor project progress

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Every step task is detailed.

2013

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Disadvantages
2013

Mobile-D is designed to fit the small system developed by a small team. Thus, it cannot be adapted to a complex business system (ex: M-commerce) in the future phone mobile industry. Besides, there are still no teacher or set guidelines for the technologies and tool selection for mobile software development. Conclusion Throughout this chapter, I began by outlining the appropriate customized monitoring solution needs analysis that the system must provide the user with, followed by the functional and non-functional requirements and different use cases and sequence diagrams possible to understand the principle of operation. This study has helped resolve some problems related to the development of the application. The next chapter will focus on the design phase.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Chapter IV

Design Phase

Introduction Objects sequence diagram Activity Diagram Class diagram Conclusion

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

4.Design Phase
2013

Introduction
We dedicate this chapter to the presentation of the architecture and design of our project. We begin by describing the architecture of our application through different dynamic views through the sequence diagram objects, and a diagram of global activities and a class diagram that will take a look at the different project entities. a- Objects sequence diagram For a comprehensive view of the sequential main features of our system, we present this system sequence diagram in the figure below:

Figure17: Objects sequence diagram Ce diagramme montre linteraction de faon squentielle entre les 3 Objets principaux du scnario, ces objets reprsentent les classes principales de lapplication. A first intervention must be set by the user, so that the application initializes.
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

b- Activity Diagram In this section we present the activity diagram associated with the entire system. According to this diagram we see that our system is multitasking, it also distinguishes several activities are triggered automatically without human intervention, it also distinguishes it lacks many alternative scenarios and this is because we try to avoid any human presence around the application
2013

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Figure18: Activity diagram c- Class diagram

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

The class diagram is a static diagram. It represents the static view of an application, it is not only used to visualize, describe and document the various aspects of a system, but also for the construction of executable code of the software application. It describes the attributes and operations of a class and also the constraints imposed on the system.
2013

Figure19: Class diagram

The class diagram of our project shows two main parts, each representing a separate application. The construction of the first frame passes all the verification and conversion
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

bytes different fields. These frames are then sent and responses are received and analyzed to be whether to proceed or not recording.
2013

Conclusion Detailed design has allowed us to have a more accurate view on the subject and a deeper understanding of the tasks. It also leads to provide software needed to achieve the goal. We have tried throughout this chapter to properly present the different conceptual diagrams of the project. These diagrams will be the basis on which we will achieve our project; this phase will be detailed in the next chapter.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

Chapter V

Implementation

Introduction

I. II. III.

Hardware environment Work Environment Screenshots and results


Conclusion

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

5.Implementation
2013

Introduction This chapter is the last part of the report of our project graduation. It aims to showcase the work completed. In this part, we will describe the implementation process of the application we are developing. We will specify our development environment, hardware, developing tools and we will present some screenshots of our application.

I.
1-

Hardware environment
Development tool
To develop our application we used a Toshiba laptop computer with an i5

processor core and 4Go Ram memory running on Windows Seven Pro Edition.

2-

Test device

we did our tests on what is called NetBox which is an electronic device powered by Android made for generally for TV entertainment, this box is characterized by 1Ghz processor, 256 Mb Ram, 4 Go flash memory for storage and powered by Android 4.0

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Figure20: the shape of the used device

II.
1-

Work Environment
Eclipse

2013

Eclipse is a multi-language development environment with a integrated development environment (IDE) and an extensible plug-in system. It is written primarily in Java and can be used to develop applications in Java and, by means of various plug-ins, other programming languages, including Ada, C, C + +, COBOL, Perl, PHP, Python, Ruby.

2-

SDK Android

Android SDK is essential to develop Android, which is a development kit created to be integrated in an IDE, it offers a set of tools necessary for the development and testing as ADT, the compiler, the emulator, the DDSM ...

3-

Photoshop

Photoshop is an editing software, processing and computer-aided drafting published by Adobe. It is mainly used for processing digital photographs, but also used for imaging and design. It is used in our application to create some graphical elements like the overall design of the interface and borders and other needs.

4-

SDK Google Drive

Drive SDK, developers proposed by Google, gives a group API client libraries, specific examples of language and documentation to facilitate the

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

development of applications that integrate with Drive. The basic functionality is to download or to mount files in Google Drive.
2013

5-

Modbus Slave

Modbus Slave is simulation software. It can simulate up to 32 slaves. Each open in this window simulator can be configured to represent the data in the same or different way for all slaves. Modbus Slave supports all Modbus functions.

Figure21: Modbus slave interface

6-

WireShark

WireShark is a powerful tool that captures the packets through an interface (sniff) and analyze catches looking case or to perform statistics. WireShark can be used to analyze network or possibly determine if a machine is infected by analyzing the connections made by malware. WireShark allows us to verify the success of

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

the communication between the entities involved in the exchange.


2013

Figure22: WireShark interface

III.

Screenshots and results


This section exhibits different interfaces for our application.

//Screenshots section is not ready yet due to graphical editing of the interfaces Conclusion In this chapter, I first presented the work environment and required tools for our application. I then illustrated the result of my work with screen printed key interfaces of the application.

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

General Conclusion
At the end of this work, we believe that this project has been beneficial, as it allowed us to consolidate our efforts and skills in designing an innovative application, which will be useful to improve the combination of industrial technology and Android world. During this project, we first conducted research on the state of telephony services in the world in order to identify the users needs. We then determined the main objectives and features to integrate into a mobile application that better meets our subjects requirements. In addition, we have learned through this experience to organize our work using the mobile-D methodology, which in our case was an efficient way to realize this project and upgrade this work to a professional level. We believe that the objectives were largely achieved. However, and like any other work, this project does not claim perfection. In conclusion, This experience was very rewarding and important because it marked the end of the engineering cycle and allowed us to face the responsibilities are those of an engineer: to meet deadlines, stress and constraints of working in a research environment and innovation.

2013

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

List of Abbreviations API : Automate programmable industrial.

2013

API : Application programming interface

ASCII : American standard code for information interchange. CRC : Cyclic redundancy check. ID : identifier.

IDE: Integrated development environment

IP : Internet protocol. MB : Modbus.

NDA : Non-Disclosure Agreement

OSI : Open systems interconnection. PLC: Programmable Logic Controller RTU : Remote terminal unit. SCADA : Supervisory Control And Data Acquisition SDK : Software development kit. TCP : Transmission control protocol. HMI / MMI: Human Machine Interface / Man-Machine Interface

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

2013

BIBLIOGRAPHIE
[1] MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b - Modbus IDA - December 28, 2006 - www.modbus.org [2] MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3 Modbus IDA - April 26, 2012 - www.modbus.org [3] MODBUS MESSAGING ON TCP/IP V1.0b Modbus IDA - October 24, 2006 http://www.modbus -ida.org. [4] MODBUS over serial line specification and implementation guide V1.0 Modbus IDA February 12, 2002 - www.modbus.org [5] MODBUS Protocol Modbus IDA November 1, 2000 [6] Google. Android Open Accessory Development Kit. Developer.android.com. [En ligne] http://developer.android.com/guide/topics/connectivity/usb/adk.html. [7] http://www.goopilation.com/2012/09/android-alibaba-acer-compatibilite.html . [8] http://searchcio-midmarket.techtarget.com/definition/SCADA [9] http://ecmweb.com/content/industrial-ethernet-infrastructure-could-top-1billion-2011 [10] http://www.mesures.com/actualites/ethernet-industriel-quatre-protocolesdominent-le-marche-5447.html

Annex

Lifecycle of an Android application


Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

2013

Figure:

Lifecycle of an Android application

Description of the function codes

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Read Coils 01 (0x01)

This function code is used to read from 1 to 2000 contiguous status of


2013

coils in a remote device. The Request PDU specifies the starting address, i.e. the address of the first coil specified, and the number of coils. In the PDU Coils are addressed starting at zero. Therefore coils numbered 1-16 are addressed as 0-15. The coils in the response message are packed as one coil per bit of the data field. Status is indicated as 1= ON and 0= OFF. The LSB of the first data byte contains the output addressed in the query. The other coils follow toward the high order end of this byte, and from low order to high order in subsequent bytes. The state diagram in the figure below describes the generic treatment of a wrong answer using function code 01, and almost all the read functions.

Figure14: Read Coils state diagram Read Discrete Inputs 02 (0x02)

This function code is used to read from 1 to 2000 contiguous status of discrete inputs in a remote device. The Request PDU specifies the starting address, i.e. the address of the first input specified, and the number of inputs. In the PDU Discrete Inputs are addressed starting at zero. Therefore Discrete inputs numbered 1-16 are addressed as 0-15. The discrete inputs in the response
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

message are packed as one input per bit of the data field. Status is indicated as 1= ON; 0= OFF. The LSB of the first data byte contains the input addressed in the query. The other inputs follow toward the high order end of this byte, and from low order to high order in subsequent bytes. The description of specific fields of function code 02 request, response and error frames is shown in the following tables respectively.
2013

Request frame size

*N = Quantity of Inputs / 8 if the remainder is different of 0 N = N+1 Response frame size

Error frame size

Read Holding Registers 03 (0x03)

This function code is used to read the contents of a contiguous block of holding registers in a remote device. The Request PDU specifies the starting register address and the number of registers. In the PDU Registers are addressed starting at zero. Therefore registers numbered 1-16 are addressed as 0-15. The

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

description of specific fields of function code 03 request, response and error frames is shown in the following tables respectively.
2013

Request frame size

Response frame size

Error frame size

Read Input Registers 04 (0x04)

This function code is used to read from 1 to 125 contiguous input registers in a remote device. The Request PDU specifies the starting register address and the number of registers. In the PDU Registers are addressed starting at zero. Therefore input registers numbered 1-16 are addressed as 0-15. The description of specific fields of function code 04 request, response and error frames is shown in the following tables respectively.

Request frame size

Response frame size


5 2

Abdallah Mahmoud _ ESPRIT

Android SCADA platform / Graduation project

Error frame size Write Single Coil 05 (0x05)

2013

This function code is used to write a single output to either ON or OFF in a remote device. The requested ON/OFF state is specified by a constant in the request data field. A value of FF 00 hex requests the output to be ON A value of 00 00 requests it to be OFF. All other values are illegal and will not affect the output. The description of specific fields of function code 05 request, response and error frames is shown in the following tables respectively.

Request frame size

Response frame size

Error frame size Write Single Register 06 (0x06)

This function code is used to write a single holding register in a remote device. The Request PDU specifies the address of the register to be written. Registers are addressed starting at zero. Therefore register numbered 1 is
Abdallah Mahmoud _ ESPRIT 5 2

Android SCADA platform / Graduation project

addressed as 0. The description of specific fields of function code 06 request, response and error frames is shown in the following tables respectively.
2013

Request frame size

Response frame size

Error frame size Write Multiple registers 16 (0x10)

This function code is used to write a block of contiguous registers (1 to 123 registers) in a remote device. The requested written values are specified in the request data field. Data is packed as two bytes per register. The normal response returns the function code, starting address, and quantity of registers written. The description of specific fields of function code 16 request, response and error frames is shown in the following tables respectively.

*N = Quantity of Registers Request frame size

Abdallah Mahmoud _ ESPRIT

5 2

Android SCADA platform / Graduation project

Response frame size

2013

Error frame size

Abdallah Mahmoud _ ESPRIT

5 2

S-ar putea să vă placă și