Monitor
March 2011

-------------------------Monitor------------------------
The Newsletter for PC-Based Data Acquisition and Control
Issue 152         www.windmill.co.uk          March 2011
--------------------ISSN 1472-0221----------------------

Welcome to the March edition of Monitor.  Here in England 
the sun is shining and spring has at last arrived.  As I 
mentioned last month, the Windmill Software company is 
20 years old this year.  As part of our celebrations we 
are pleased to offer you our lowest ever price on 
measurement hardware.  See below for more details or visit 
https://www.windmillsoft.com/daqshop/analogue-input.html

Don't forget, Windmill data acquisition software is still 
on offer at £50, 60 Euros or US $80.  With this package 
you can log data from, and control, up to 10 instruments 
which can send data via RS-232, RS-422, RS-485 or Modbus.  
You can find out more at 
https://www.windmillsoft.com/daqshop/rs232-modbus.html

We hope you find the newsletter useful, but should you 
wish to remove yourself from our mailing list please 
go to 
Monitor Newsletter

CONTENTS
========
* Windmill News: Half Price Measurement and Control via USB
* Multiplexing Analogue Inputs
* Excel Corner: Setting the interval between data readings
* Data Acquisition and Control News Roundup
________________________________________________________
________________________________________________________

Windmill News: Half Price Measurement and Control via USB
________________________________________________________

We are delighted to bring you our lowest ever price on 
data acquisition and control hardware.  For just £147, 
US $239 or 169 Euros you get 
- the 750 unit which plugs into the computers USB port,
- the Windmill logging, charting and control software 
  suite, for USB devices,
- technical support for life by e-mail or telephone.

With the 750 system you can...

- Measure voltage through 16 analogue inputs
- Switch up to 16 digital outputs (relays etc)
- Monitor up to 16 digital inputs
- Count events with up to 8 counters
- Log and chart data, count, control outputs and send data 
  to Excel or other Windows software: no programming 
  is needed
- Connect up to eight 750s to a PC, providing 
  128 voltage inputs

We offer a money-back guarantee: if the 750 system doesn't 
do what you want simply return it for a full refund.  

For computers running Windows 10, 8, 7, Vista, XP and 98.

The offer is running from now until 30th April.  To try 
the 750 at the low price go to 
https://www.windmillsoft.com/daqshop/analogue-input.html, 
e-mail sales@biodataltd.com or 
telephone +44 (0)161 833 2190.
________________________________________________________
________________________________________________________

Multiplexing Analogue Inputs: 
________________________________________________________

When data acquisition equipment receives an analogue 
signal, it digitises it, converting it into a format that 
the computer can understand.  This is done by an 
analogue-to-digital (A/D) converter.

An A/D converter can only digitise one signal at a time.  
Some data acquisition systems provide an A/D converter 
for each analogue input.  However, it is more common to 
switch (multiplex) the signals in turn to one converter.  
This method is used in lower cost systems like the 750.

Settling Time and Cross-Talk
============================

As the multiplexer switch one input after another to 
the A/D converter, you must allow time for each reading 
to settle to its new value.  This settling time defines 
the minimum interval between reading each input.  If you 
try to go faster than this there will be increasing 
cross-talk between channels, leading to inaccurate results.  
Cross-talk is when one channel's signal causes an 
undesired effect on another

Logging Data from only Some of the Connected Inputs
===================================================

For test applications you may want to read from some 
inputs in one test run and from a completely different 
set of inputs in another. You obviously don't want to 
slow down the system by reading all channels every time.  
Software like Windmill avoids this by letting you select 
as sub-set to scan for each test.  This avoids the need 
to rewire your connections each time you want to record 
some data.

You can find out more on multiplexing at 
https://www.windmill.co.uk/multiplexing.html
________________________________________________________
________________________________________________________

Excel Corner: Setting the interval between data readings
________________________________________________________

You can use Windmill Logger to regularly collect data 
and store it in files; periodically starting a new file 
for long-term logging.  Once Logger has closed a file you 
can open it in Excel.

There are some situations though, when you will want to 
use Excel to regularly capture data from instruments and 
devices.  To do this you need to use a macro.  A typical 
data collection macro is given at 
https://www.windmill.co.uk/excel/#Excel

When taking readings at regular intervals which are 
controlled by Excel, the macro must pause for a while 
before taking the next reading. There are several ways 
to do this, the most often used being Wait or Sleep.  
These are detailed below, but both have the disadvantage 
of tying up Excel whilst the macro pauses. There is a 
way round this: by logging only when new data arrives.  
See below for details.

Using The Wait Method
=====================
The Wait method pauses a running macro until a specified 
time. For example

Application.Wait(Now + TimeValue("0:00:10")) 

would wait for 10 seconds.

Using Wait has a couple of disadvantages.
1. The minimum Wait time is 1 second, so sampling rates 
   of less than one sample per second would not be possible.

2. The Wait method suspends all Microsoft Excel activity 
   and may prevent you from performing other operations 
   on your computer while Wait is in effect. However, 
   background processes such as printing and 
   recalculation continue.


Using the Sleep Function
========================
Before your macro you need this declaration statement:

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

This is because Sleep is a Windows API - application 
program interface - which is available from the 
Windows operating system.

In your macro, to sleep for 10 seconds, use
Sleep 10000
(Sleep is measured in milliseconds.)

Disadvantages of using Sleep
1. Again, Excel activity will be suspended for the 
   duration of the Sleep.

Logging only when New Data Arrives
==================================

This method lets the Windmill DDE Panel control the 
timing, rather than Excel. It only runs the 
data collection macro when new data is available from 
your instrument.

1. In Windmill DDE Panel select the 
   Copy to Clipboard button and copy data from 
   All Channels. 

2. From Excel's Edit menu choose Paste Special and 
   "Paste as Links" into the first row of a worksheet 
   called "Sheet1". 

3. Create the code given below and run MonitorDDE. 

The MonitorData routine monitors cells which are showing 
live data via DDE. When values change, it calls 
the LogData procedure which progressively writes the 
readings into new rows in the worksheet.  You will 
need to change the channel name from "My_Channel" to 
match your data channel, as the DDE Panel displays it.

Dim NoOfRows As Integer

Sub MonitorData()
NoOfRows = 2
' Monitors the DDE links for updates
' When data is updated runs the subroutine LogData
ActiveWorkbook.SetLinkOnData "Windmill|Data!My_Channel", "LogData"
End Sub

Sub LogData()

NoOfRows = NoOfRows + 1
Column = 1

'Initiates conversation with Windmill DDE Panel
ddechan = DDEInitiate("Windmill", "Data")

'Requests data from "My_Channel" and stores it in
'memory under mydata.
mydata = DDERequest(ddechan, "My_Channel")

'Inserts data into the first column of Sheet1
Sheets("Sheet1").Cells(NoOfRows, Column).Value = mydata

'Ends DDE conversation
DDETerminate (ddechan)
End Sub

Further Reading: Using Excel for Data Acquisition
https://www.windmill.co.uk/excel/
________________________________________________________
________________________________________________________

DAQ News Roundup
________________________________________________________

Welcome to our roundup of the data acquisition and 
control news.  If you would like to receive more 
timely DAQ news updates then grab our RSS newsfeed 
at https://www.windmillsoft.com/monitor.xml.  Read 
https://www.windmill.co.uk/newsfeed.php for notes
on how to display the live news on your own web site.

Stuxnet analysis finds more holes in critical software 
   Dozens of security holes have been found in SCADA 
   (supervisory, control and data acquisition) software, 
   and the European Commission is launching research to 
   defend critical infrastructure
   Source: New Scientist
   http://www.newscientist.com/

System Transmits Data Through Steel
   An engineer at Rensselaer Polytechnic Institute has 
   developed a system that uses ultrasound to 
   simultaneously transmit large quantities of data and 
   power wirelessly through thick metal walls, such as 
   the hulls of ships and submarines. 
   Source: Rensselaer Polytechnic Institute 
   http://news.rpi.edu/update.do?artcenterkey=2836 

Seismic Sensing Breakthrough 
   HP have announced a new inertial sensing technology 
   that enables the development of digital micro-electro-
   mechanical systems (MEMS) accelerometers that are up 
   to 1000 times more sensitive than high-volume products 
   currently available. 
   Source: HP
   http://www.hp.com/hpinfo/newsroom/press/2009/091105xa.html 

Demand for Industrial Control Equipment Continues to Rise
   NEMA's US Industrial Controls Index has gained 
   24 percent in a year. Nonetheless, inflation- and 
   seasonally-adjusted shipments of industrial 
   control equipment still have an appreciable 
   amount    of ground to make up before surpassing 
   the previous    cyclical peak. 
   Source: NEMA
   http://www.nema.org/

Motion Sensors Detect Horse Lameness
   Motion sensors placed on a horses head and body are 
   monitoring and recording a horse's torso movement while 
   the horse is trotting, in a new system to 
   detect lameness. 
   Source: University of Missouri
   http://www.umsystem.edu/
________________________________________________________
________________________________________________________

* Copyright Windmill Software Ltd
* Reprinting permitted with this notice included
* For more articles see https://www.windmill.co.uk

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 
https://www.windmill.co.uk/newsletter.html
and an index of articles at 
https://www.windmill.co.uk/monitorindex.html

Windmill Software Ltd, PO Box 58, North District Office,
Manchester, M8 8QR, UK
Telephone: +44 (0)161 834 6688
Facsimile: +44 (0)161 833 2190
E-mail: monitor@windmillsoft.com

https://www.windmill.co.uk/

https://www.windmillsoft.com/

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.

Subscribe Monitor

You will receive an e-mail confirming your subscription, with details of how to download the free software. If you don't receive this then your spam filter may be blocking our message. Make sure it is set to accept messages from monitor@windmillsoft.com. If you have problems contact the Editor.

Previous Issue Next Issue