Windmill Software Ltd
Windows Engineering Software

Windmill
January 2000

Monitor Newsletter Archive

Home
Newsletters
Shop


Issue 18: Process Control, Oil and ActiveX

CONTENTS

Windmill News | New Year Survey | Process Control in the Oil and Gas Industry | VB Corner - Displaying Measurements on a Web Page


WINDMILL NEWS: EDUCATION SUCCESS WITH WINDMILL!

A new education kit for schools and colleges uses the Windmill Software demo to explain control technology. (You can download free copies of this process control demo from http://www.windmill.co.uk/windmill7.html)

The Windmill Graphics software was seen as essential for students' information technology skills. The software lets them control a process from their PC screens. By pointing and clicking they can simulate closing drain valves, filling tanks, starting heating operations, and so on - thus familiarising themselves with process control.

Other skills taught by the control technology resource include:

  • Using level control systems with digital sensors
  • Temperature control with digital and analogue sensors
  • Monitoring systems
  • Data logging

Feedback from teachers indicate that the kit has been universally well received. It was developed and distributed to schools and colleges by the Higher Still Development Programme.

For more details of the education programme visit http://www.windmill.co.uk/education.html.
For more details on Windmill Graphics visit http://www.windmill.co.uk/graphics.html.
To purchase a fully working version of Windmill Graphics visit https://www.windmillsoft.com/daqshop/software.html


NEW YEAR SURVEY

As an aid to improving our services we would be very grateful if you could fill in this brief survey. All information is confidential and won't be passed to any third parties. Miss out any questions you don't want to answer.

  1. Have you downloaded our free Windmill data acquisition software?
    Yes No
  2. Have you successfully used the Windmill software with any RS232 (serial) instruments?
    Yes No
  3. If so would you be prepared to contribute your instrument settings file (*.aid) to a free library? Any person with a similar instrument could then download the appropriate settings and speed up their configuration.
    Yes No
  4. Did you experience any problems with the Windmill software and if so what were they? (Please say if you resolved the problems, or if you would like our assistance.)
  5. We're interested to know how people are using the free Windmill software. If it's not commercially sensitive information, we'd appreciate brief details.
  6. Are there any topics you would like us to cover in the Monitor newsletter?
  7. What is your job title and industrial sector or academic discipline?
    Job:
    Industry:
  8. Any other comments or suggestions on the Windmill suite of software or the Monitor newsletter?

    Name:
    E-Mail:

  9. (You'll be returned to this page after pressing Send Survey.)

PROCESS CONTROL IN THE OIL AND GAS INDUSTRY: EDUCATION RESOURCES

The education kit featured in the Windmill News, used examples from the oil and gas industry to provide real life illustrations of control technology. Much of the information came from UKOOA, whose web site is detailed below.

UK Offshore Operators Association
UKOOA is the representative organisation for the UK offshore oil and gas industry. Making the oil and gas industry more open, accessible and accountable is the major thrust of their strategy. As one way of achieving their mission they provide a great deal of education resources for teachers. Their site also gives a glossary of terms used in the industry, news headlines and environmental reports detailing issues, discharges and emissions.
http://www.ukooa.co.uk/
Institute of Petroleum
The Institute of Petroleum is another site which provides a range of educational resources on process control in the oil and gas industry. It's an independent European centre for the advancement and dissemination of technical, economic and professional knowledge relating to the international oil and gas industry. For 60 years it has been one of the principal independent bodies in Europe. Its objectives include lifetime learning and to increase the knowledge and understanding of the oil industry by young people. A large amount educational material reproduced is on its web site.
http://www.petroleum.co.uk/
Offshore Technology
Another web site in a similar vein is Offshore Technology's. Their current projects section gives masses of information on individual oil fields, including process control details.
http://www.offshore-technology.com/

VB CORNER

Last time we reviewed how to use HTML to provide the layout and user interface for your VB application. This month we go one step further and look at how we can get data from Windmill into your HTML page. The title VB Corner is in fact a misnomer this month. We've written the script for the HTML page in JavaScript since this is easily used with a web browser such as Internet Explorer. However, the script could have been written in VBscript and the same principles apply.

The easiest way to communicate with the Windmill system from a web page is to use an ActiveX control. Windmill's IML Tools control sets up your data acquisition hardware or instruments, sends data to them and reads back data values from them. In this way you are relieved of the tedious programming task of communicating directly with the hardware. You can also re-use your code with many different instruments and devices.

For reasons of space we have not included the entire JavaScript code and sample html page here, but invite you to download it from here.

The examples given assume you are using the IML Tools ActiveX control. They explain how to display data from 3 measurement channels on a web page, and update the readings every time a button is pressed.

*

Overview of JavaScript and HTML Coding for Data Acquisition

  1. Within the <HEAD> of the HTML page we need to:
    - Declare the ActiveX control as an object on the page
  2. Elsewhere on the HTML page we need to:
    - Create a table with cells identifying where the data should be placed.
  3. Within the JavaScript part of the page we need to:
    1. Configure the hardware by loading a file containing all the configuration details
    2. Set which channels to read, and the ID of the table elements where data will be posted
  4. Within the <BODY> of the HTML page we need to:
    - Call the JavaScript function
  1. DECLARING AN OBJECT
    To declare the control as an object on the page we use this code
       <OBJECT ID="IMLcontrol" WIDTH=64 HEIGHT=63
        CLASSID="CLSID:1FCF5582-2A14-11D3-9743-525400DDF830">
           <PARAM NAME="_ExtentX" VALUE="1693">
           <PARAM NAME="_ExtentY" VALUE="1667">
       </OBJECT>
    
    The CLSID allows the page to uniquely identify the component it is trying to load. It comes from the Windows registry.
     
  2. CREATING A TABLE WITH CELLS TO HOLD THE DATA
    Each table cell designated to hold data must be uniquely identified. For example, to identify a cell as CHAN0 you could use this HTML.
      <TD><SPAN ID="CHAN0"></SPAN></TD>
    In the JavaScript code a line like this will write the reading into the table cell
       Chantxt=document.all("CHAN0");
    1. JAVASCRIPT FUNCTION TO CONFIGURE THE HARDWARE
      Configuring the hardware means, for example, specifying engineering units (oC for example) and setting the expected maximum and minimum data values for each hardware measurement channel. In a Windmill system you do this in the SetupIML program, by making choices from dialogue boxes and then saving a file containing your selections. This file is called an IMS file. Once you've created an IMS file all you need to do is send it to the hardware, and the hardware will be appropriately configured.
       
      To do this in JavaScript you need to state which file you want to use. So, you need a line looking like this
           var IMSfilespec="c:\\wm5\\test.ims";
      To load the file we use
           x=IMLcontrol.IMSLoadFile(IMSfilespec,IMSname);

      So in a couple of lines we have selected the measurement type, range, data format, alarm settings, engineering unit conversion and so on, individually for all channels. (Note, in the full example more lines are used, as error checking to ensure the IMS file is found is also included.)
       
    2. JAVASCRIPT FUNCTION TO READ AND DISPLAY DATA
      The JavaScript and html examples given in the jan2000.zip file, are written so that data is read immediately the page is loaded, using the function:
           getIMLdata()

      After that data is read every time a user clicks a Refresh button on the web page. Of course, we could alter the code so that data is refreshed every so many seconds, or when another event occurs.
       
  3. CALLING THE JAVASCRIPT FUNCTIONS
    The first function called is to configure the hardware (which we obviously need to do before we can read any data). If the hardware configuration function is called initControl, we do this then with the
    <BODY onLoad="initControl()">
    HTML tag.
     
    It takes just 45 lines of JavaScript code to display our example of data from 3 measurement channels. These channels might be, for example, two thermocouples and one pressure transucer. Alternatively they might be one weight reading from a balance, one temperature reading and one humidity reading. In fact, the measurement may come from almost any type of sensor or instrument.
     
    This concludes our current series of VB Corners. We hope you enjoyed them. Should you need customised data acquisition software, written in Visual Basic or other langauges, Windmill Software's team of software programmers would be pleased to send you a quote for your project.

Our other Visual Basic articles are in:


Do you have a question, comment or suggestion on this newsletter? E-mail the editor - Jill Studholme - at [email protected]

Copyright 2000 Windmill Software Ltd. All rights reserved. You may freely forward this newsletter in its entirety, but please don't reproduce individual sections without the prior written agreement of Windmill Software Ltd.


Subscribing

To receive Monitor every month please fill in your e-mail address below. We will not pass your address to any third parties, nor send you any unsolicited e-mail.

*  Email:
*  Format:

Previous Issue Next Issue