A Remote Control and Supervision Device Through Internet

A Remote Control and Supervision Device Through Internet

Copyright @ IFAC Telematics Applications in Automation and Robotics, Weingarten, Germany, 2001 A REMOTE CONTROL AND SUPERVISION DEVICE THROUGH INTERN...

378KB Sizes 0 Downloads 73 Views

Copyright @ IFAC Telematics Applications in Automation and Robotics, Weingarten, Germany, 2001

A REMOTE CONTROL AND SUPERVISION DEVICE THROUGH INTERNET Martin Soto-Cordova

Research and Development Division National Institute for Research and Training in Telecommunications (INICTEL)

Abstract: This paper presents a TCPIIP hardware and software device developed at the INICTEL. What the device does is provide users connected to Internet with a consistent means to access a wide variety of controlled devices in a simplified fashion, i.e. this application allows to control and to monitor both processes and events occurring at remote sites. The device circuit and operation are described. As new technologies for Internet applications evolve, many new services arise as well. This paper focuses on Internet as an access medium to control and supervise devices located at remote sites through the use of TCPIIP protocols. Copyright @200J [FAC

Keywords: Communication Protocols, Ethernet, Telecontrol, Programmable Controllers.

example, the device supports HTTP, the use of a WWW browser running on another computer on the network can eliminate the need for an otherwise complex and costly display and/or keyboard on the device. However, for this particular cost-benefit trade-off to result in a net savings, the cost of adding the network functions must be less than the cost saving from simplifying and/or eliminating the display and/or keyboard functions.

1. INTRODUCTION In the last several years, with the commercialisation of the Internet and the explosive growth of the World Wide Web (WWW), the realisation of many people's dream of a universal information database is a reality. It's accessible to people from around the world, and organised in a way that related information is easily discovered.

With the wide spread deployment of the Internet and the WWW, both as a public resource and as corporate and home private resources, people have come to recognise the utility of attaching low-cost devices to networks for the purposes of communicating with these devices using standard networking protocols, including TCP, IP, and HTTP. In fact, connecting almost any device to a network immediately increases the utility of that device because that it can now be accessed remotely for the purposes of data display, remote control, testing, diagnosis, configuration, communication, etc. If connected to the Internet, that device becomes instantly accessible from virtually any place in the world.

2. A DEVELOPED SYSTEM Figure 1 shows the block diagram of the embedded Internet-based device. The device operation runs under own developed HW & SW. It has four phases: system start-up, packet transmtssJOn, packet receiving, and device controlling and monitoring. In the system start-up the microcontroller has a function of beginning the configuration internal registers of the Ethernet controller before to be ready to receive and send packets. This phase includes MAC address and IP address allocation. The configuration parameters either could be loaded by host (microcontroller) or could be previously buffered within EEPROM memory. Finally, occurs the beginning of the peripheral connected to module (LCD screen, AID channel, sensors, etc.). Several controlled peripherals could be attached to RS232 and RS485 ports. At INICTEL, an educational

Almost any device, which contains a computer, can benefit from a network connection. In fact, a network connection even can result in a reduction in the cost of a device, both in terms of total ownership cost, or often times, in terms of initial device cost. If, for

105

3. THE SYSTEM DESCRIPTION

application was developed: Real Remote Laboratory. It includes a WebCam and specific hardware to a physical experiment.

Figure 2 shows our circuit implementation. This small board enables microcontroller based projects to communicate over IObaseT Ethernet. Any controller that has two 8-bit bi-directional I/O ports can use this board. Application around this prototype shows how to control the board as well as how to implement basic TCPIIP functionality using the most popular microcontroller available today. The code for the microcontroller is written in assembler and the major functions are Ethernet Controller initialisation (configure MAC address, IP address assignment, etc.), send and receive packets, re-route those for serial communications, etc. The hardware implementation has two modules: Control module and LAN communication module.

Controlled Peripherals

1 ~oo~d ,...._....- .. Ethemet

Fig. 1. Architecture of the developed system

During normal operation the system does two basic functions: Ethernet frames transmission and receiving. The packet transmission occurs in two phases: In the first phase the microcontroller carry the Ethernet frame on the controller buffer memory. It signals to CS8900 that a frame goes to be transmitted and it order to chip when to begin the transmission (after it have transfer 5, 381, 1021 or all Bytes) and how frame will be transmitted (i.e., either with or without CRC, either with or without pad bits). In second phase, the controller converts frame in Ethernet packet and transmits it over the network. The preamble and start of frame delimiter are followed by the destination address, source address, length field and LLC data (all supplied by the host). The packet receiving also occurs in two phases: In the first phase the Ethernet controller receives an Ethemet packet and stored it in memory of the chip. If frame destination address is equal to address filter (It includes a programmed address); the packet is stored in internal memory of CS8900. It checks CRC and informs to microcontroller a frame was received. In second phase, host transfer received frame to memory of host for its treatment subsequent.

Fig. 2. Prototype implementation

3.1 The Control Module It controls the system function. It includes a microcontroller and several peripherals related to RS232 and RS485 interfaces, LCD displaying, reading and writing to EEPROM memory (64KB), handling of IN/OUT devices, etc. The Figure 3 shows this module. The PlC drives the Embedded Ethernet board and implements some very basic TCPIIP functionality.

106

memory allowing it to send and receive packets asynchronous to the microcontroller. The Ethernet Controller can operate directly on the ISA or PCI bus and use DMA to access external RAM for incoming and outgoing packets and control information. The Crystal part also operates in this mode but also has an 8 bit mode allowing it to interface to microcontroller with a minimum of VO capacity. The board design further minimises the VO needed and requires only 16 I/O pins. A 4-bit address bus, 8-bit data bus, and 4 control signals (/RD, fWR, IAEN, and INTR) are all needed to control the board and communicate on the Ethernet.

The PlC doesn't really have the SRAM needed to fully implement even a minimal TCPIIP stack, but the application can be specialised to a particular task (such as reading transducers and connecting to a remote UDP client). The main microcontroller functions are starting of peripheral and management of protocols over LAN frames .

LANCommun. Module Connector Driver

TIL-RS232

LAN 20MHz

IOBaseT

Oscillator

Transformer isolator

Ethemet Controller

Control Module Connector

Activity indicator

RJ45 Connector

Fig. 4. LAN communication module implementation

3.3 The Control Software and System Testing Microcontroller

The system control software was developed in MPLAB environment supported by Microchip Corp., It includes all necessary tools: project manager, assembler, simulator, programmer. Also, the code was developed in assembler code. By other way, the test circuit, once connected to the Ethernet, can be pinged from another node. Also, we have developed a Windows Sockets program in Visual Basic. It implements a UDP client and asks the prototype for data transmit. In this case the prototype acts as a UDP server and the code for the TCPIIP stack is

PICI6F877

Fig. 3. Control module implementation with microcontroller 3.2 The LAN Communication Module

Figure 4 shows the LAN module. The Crystal CS8900A Ethemet Controller has 4KB of integrated

107

implemented in assembler. Basically, there are implemented three protocols: ARP (address resolution protocol), lP, ICMP (for echo ping requests) and UDP. The Figure 5 shows this data display on computer.

Fig. 5. The test environment

4. CONCLUSIONS This paper has described briefly the advantages of embedded Internet-based devices, and the operation of our designed device. Several applications are possible, data display, remote control, testing, diagnosis, configuration, communication, management, supervision, etc. This device becomes instantly accessible from virtually any place in the world. Currently, several tasks related to this device are carrying out: the adoption of management applications, security protocols, etc.

108