Instrumentation Remote Control through Internet with PHP

INTRODUCTION Computer based instrument control automates the measurement process, making it more reliable and cheaper then when it is done manually by programming individually each instrument through its command panel for every measurement process. Internet allows computer based measurements to be made remotely from almost everywhere with many advantages, either in research, industrial or teaching environment. Instrument operators do not need to be in the laboratory to control their tasks; in hazardous environments this might be crucial. The remote access to a teaching laboratory within an e-learning platform, allows students to use the equipment with less restrictions in time, being able to repeat experiments at their own pace. The GPIB (General Purpose Interface Bus) is today’s de facto standard interface for computer based control of standalone instruments. Though it is being used for over 30 years, its performance, robustness, reliability and simplicity of use have kept it being widely used in the instrumentation industry, and will probably keep it being used for many years to come [1][2]. The GPIB is a digital 8-bit parallel interface that uses 24 lines, 16 of these carrying TTL negative logic signals, and the remaining 8 being used for ground. The 16 signal lines are divided into three groups: 8 data lines, 3 control lines and 5 management lines (fig. 1). The data lines carry messages, either data or specific commands to or from the devices, addresses, and GPIB commands. The control lines use a handshake mechanism to control the asynchronous communication between devices in the bus. The management lines allow the controller to perform all the management operations on the bus [4][5].

PHP (PHP: Hypertext Preprocessor) is a programming language originally created for the implementation of dynamic contents in Web pages [6]. It is an object oriented language, with syntax similar to C/C++ and PERL, that allows the development of efficient and robust Web applications. PHP runs on the server side, with efficient CPU and memory use, on many platforms. It is free and Open Source software, with developers all over the world. For these reasons it has become one of the most widely Web scripting languages in use. PHP is provided with many extensions to interact with other applications, namely databases and Web servers, and allows the development of others to provide more functionalities, if needed. It is perfectly suited to work with the free Open Source packages Apache HTTP server [7] – the most used Web server – and MySQL [8] – the most popular relational database management system for Web applications. The purpose of the work described in this paper was twofold. First, the creation a PHP extension that, with a HTTP server, makes the functionalities of a GPIB controller available remotely. Second, the development of a set of PHP classes to ease the creation of applications that use this extension to control instruments. This allows instrumentation remote control with Web browsers, without needing any special client software.

Though there is the effort of the Open Source software communities to provide solutions that span over most of the industrial, governmental or educational domains, the fact is that Win32 platforms keep being extensively used for instrument control and data acquisition. The lifetime of industrial, educational or research equipment exceeds the typical lifetime of general purpose computers and software. When this project began, we were not able to find any solution for GPIB control through PHP for the Win32 platform, though for Linux platforms there is such a solution [9][10]. Similarly, in spite of the PHP widespread use, no set of general use tools to create GUIs for instrument control and data visualization through browsers, similar to the one presented, was found for either of the platforms.

INSTRUMENTATION REMOTE CONTROL The concept of instrumentation remote control through the Web has been around for more than one decade, either in the industry, research and education environments. A standard for instrument control through Ethernet has been established with the VXI-11 protocol [11][12] that can be used with the VISA API [13], either within several commercial off-theshelf products for instrumentation control, like LabVIEW [14] from National Instruments or VEE [15] from Agilent, or more generic IDEs like Microsoft Visual Studio [16]. Several groups have developed remote educational laboratories for engineering and science teaching [17]–[20], which play an important role in the emerging arena of e-learning. Our approach with this project aims to be as simple as possible in its set-up, using free and Open Source software, within the Win32 platform, and to present very few requisites for the remote users.