Windmill Software Ltd
Windows Engineering Software

November 2004

The Newsletter for PC-Based Data Acquisition and Control
Issue 76       November 2004
--------------------ISSN 1472-0221----------------------

Welcome to the 76th issue of Monitor
.  Today we discuss 
how to log up to 200 data readings a second using Excel 
and our free Windmill software.  We hope you enjoy the
newsletter, but should you wish to cancel your 
subscription you can do so at

* Windmill News: Seabed Surveying and Mapping
* Excel Corner: Logging Data up to 200 Times a Second
* Data Acquisition and Control Exhibitions

Windmill News: Seabed Surveying and Mapping

At the University of Queensland's Zoology Department, 
they use a variety of different methods for seabed 
surveying and mapping. All of their surveys require 
GPS positions for each sample, so they can spatially 
analyse and present the data. The scientists needed some 
software to record positional data during sampling over 
a "track" (rather than "point" sampling). For instance: 
sampling by trawling, by "towed diver" visual surveys 
and by towed video surveys. The software they chose 
was Windmill.

The great benefit of Windmill is that it is possible to 
record the "track" of each sample directly into Excel in 
real time. Once the sample is obtained (and its track 
recorded in Excel) they can enter observations and any 
other notes alongside the positional information for each 
sample, whilst still in the field. In all it saves a huge 
amount of time in writing and data entry, as well as 
preventing the problems of interpretation and mis-placing 
of data which sometimes occurred with the old practice of 
recording the information on sheets of paper.

The ability to integrate other instrumentation such as 
echo sounders, water quality meters etc. offers further 
possibilities which the scientists plan to explore in 
the future.

To use Windmill for this type of application you need 
its serial driver.  Details of the latest version of 
this, COMIML, are at 
Alternatively, as a subscriber to this newsletter you 
can download an older version (LabIML) for free.

Further Reading 
For more on Windmill software:
Article on interfacing GPS Receivers:

Excel Corner: Logging Data up to 200 Times a Second

We've discovered that the example of how to use Excel 
to continuously log data, which we used to give on the 
web site, didn't work well if the sampling interval was 
less than once a second.  We've therefore updated it to 
work properly at speeds of up to 200 readings (samples) 
per second.  The new version is given below.  Start 
displaying data in the Windmill DDE Panel program before 
running the macro.


Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Sub SampleData()

'If NoOfRows = 1, the first data value
'will be placed in row 1.
NoOfRows = 1

'Ask for number of sets of samples to be collected.
NoOfSamples = Val(InputBox("Please enter no of samples to collect", "No of Samples"))

'Ask for the time to wait between taking each set of samples
SamplePeriod = InputBox("Please enter sample interval in seconds", "Sample Interval")

' Convert to milliseconds - needed for sleep statement below.
SamplePeriod = SamplePeriod * 1000

'Initiates conversation with DDE_Panel
ddeChan = DDEInitiate("Windmill", "Data")

'Keeps conversation open until the required
'number of samples have been collected.
While NoOfRows < NoOfSamples + 1

'Requests data from all channels and stores it in
'memory in an array called mydata.
mydata = DDERequest(ddeChan, "AllChannels")

'Selects first sheet in currently selected workbook.

'Ignores any warning messages which would halt the macro
On Error Resume Next

'Finds the lower & upper boundaries of array,
'to determine the number of columns needed to
'store the data.
Lower = LBound(mydata, 1)
Upper = UBound(mydata, 1)

'Inserts data from the array into a row of cells.
For Column = Lower To Upper
Cells(NoOfRows, Column).Value = mydata(Column)
Next Column

'Waits for the specified sample interval
Sleep SamplePeriod

'Increments number of rows, so next set of samples
'is inserted in the next row down.
NoOfRows = NoOfRows + 1

'Stops loop when required sets of samples collected.
DDETerminate (ddeChan)
End Sub


Changes Made to the Data Logging Macro

Instead of using "Wait" to pause the macro for specified 
logging interval, we've used "Sleep".  So why did we use 
Wait in the first place?  The macro was originally written 
for an early version of Excel, and the Sleep instruction 
wasn't available then.

Note that Sleep isn't a standard Excel function. It is 
contained instead in a Windows DLL. So we need to tell 
the Excel VBA interpreter where the Sleep function can 
be found. This is done in the Declare statement:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
This tells VBA that the Sleep procedure can be found in 
kernel32.dll and that it expects a time in milliseconds 
as its parameter.

Further Reading
For more on using Excel with Windmill see


Data Acquisition and Control Exhibitions

Continuing the quarterly list exhibitions around 
the world related to data acquisition and control.

ISA Show South America
  23 - 25 November
  Sao Paulo Brazil 
  The major South American event in the automation, 
  systems and instrumentation technology sectors.

Measurement Science Conference 
  17 - 21 January
  California USA
  Promoting education and professionalism in measurement 
  science and related disciplines.

  16 - 17 February 2005
  NEC Birmingham UK
  The UK's national showcase for the sensor, measurement 
  and instrumentation industry.

National Manufacturing Week
  7 - 10 March 2005 
  Chicago Illinois USA
  Includes industrial automation and design engineering.

  17 - 20 March 2005
  Istanbul Turkey
  Industrial automation fair.

  5 - 8 April 2005
  Warszawa Poland
  International fair for measurement and control.

  11 - 15 April 2005
  Hannover Germany
  The leading trade fair for process automation.

Test and Measurement China 2004
  12-15 April 2005
  Shanghai China
  The exhibition encompasses test and measurement 
  equipment such as meters, bare board testers, optical 
  inspection system, circuit testers, x-ray equipment, 
  test fixtures etc.

* Copyright Windmill Software Ltd
* Reprinting permitted with this notice included
* For more articles see

We are happy for you to copy and distribute this 
newsletter, and use extracts from it on your own web site 
or publication, providing the above notice is 
included and a link back to our website is in place.

An archive of previous issues is at
and an index of articles at

Windmill Software Ltd, PO Box 58, North District Office,
Manchester, M8 8QR, UK
Telephone: +44 (0)161 833 2782
Facsimile: +44 (0)161 833 2190
E-mail: [email protected]


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.


Previous Issue Next Issue