Monitor - ISSN 1472-0221
The Newsletter for PC-Based Data Acquisition and Control
Issue 116, March 208
I hope you enjoy the newsletter but if you want to remove yourself from our mailing list please do so at https://www.windmill.co.uk/newsletter.html
CONTENTS
* Windmill Notes: Connecting a Sylvac Dial Gauge to a PC
* Excel Corner: Working with Collections of Data
* DAQ News Roundup
Windmill Notes: Connecting a Sylvac Dial Gauge to a PC
A dial gauge accurately measures small deviations or distances. You might use it, for instance, for compression testing or to measure the bending of oscillating rods under strain. Some dial gauges are mechanical and some, like the Sylvac range, are digital.
Digital dial gauges (or digital indicators as they are also known) have the advantage that you can connect them to a PC and automatically record all measurements. This is invaluable in applications where a sequence of readings is taken over time.
How to connect a Sylvac Dial Gauge to a PC
To transfer data from the dial gauge to your PC you need some data acquisition software like Windmill. You could use the free Windmill 4.3 software with the LabIML driver - available to Monitor subscribers, or the newer and easier-to-use Windmill 6 with the COMIML serial driver - available from https://www.windmillsoft.com/daqshop/rs232-modbus.html.
You also need a Sylvac OPTO-RS cable. This is not only a cable, but an interface which converts the output of the gauge to a RS232 signal. Plug one end of the cable into the dial gauge and the other into a COM port of the PC.
If your PC does not have any COM ports you can use a USB-Serial converter.
Configuring the Windmill for a Sylvac Dial Gauge
There are three basic steps to setting Windmill to log data from a Sylvac gauge.
- Run the Windmill ConfIML program and enter the gauge's settings.
- Run the Windmill SetupIML program and choose a name and units for your data.
- Run the Windmill DDE Panel or Logger program to display or save data.
Once you have configured the Windmill software you can in future go straight to logging data.
One of our readers has kindly compiled a guide to using Windmill with a Sylvac dial gauge, which you can download from https://www.windmill.co.uk/sylvac.pdf
*
Windmill ConfIML
This program detects and saves a record of the hardware you want to use, in our case a Sylvac dial gauge.
- Start ConfIML and Press the Add button.
- Select LabIML RS232 ASCII Instrument Handler.
- Type a name for the dial gauge, a description and enter 1 for the number of channels of data. Press OK.
- Enter your instrument's settings as follows
- Reading Protocol: Request/Response on Demand
- Timeout: 1000
- Instrument Idle or Wait Time: 0
- Returned Message Length: 20
- Instrument Initialisation String: Leave blank
- Reading Protocol: Request/Response on Demand
- Click the Channels button. Enter the instructions to
extract the reading from the string of data sent
by the gauge.
- Make sure that Read channel is checked
- Enter the engineering units your gauge uses, eg mm
- You can ignore the maximum and minimum settings:
these are just a guide for chart scaling etc.
- Prompt string: the OPTO-RS interface will accept
any character as a request to transmit the data
value, so you can enter any letter you like here.
- These two examples illustrate the format of data sent
by a Sylvac gauge. <cr> is a carriage return
+00.0000<cr>
-000.000<cr>
In the Reply Parse String enter: \I"+-"\E"\C013.
This instructs Windmill to ignore everything until a + or a - sign occurs, and then to collect all characters until it reaches the carriage return.
- Click OK to close the Channels box and then the Instruments box.
- Make sure that Read channel is checked
- Enter these communications settings:
- Baud: 4800
- Data Bits: 7
- Parity: Even
- Flow control: None
- Save your settings, close ConfIML and start SetupIML.
*
Windmill SetupIML
With the SetupIML program you can name your channel, set units, alarms and so on.
- Choose to Create a New Setup and enter a name and description. This can be anything you like.
- From the Device menu select LabIML.
- Your data channels will be shown as a number like 10000. Double click this.
- Type name for your channel, eg Sylvac and make sure Enable for Input is checked.
- Save your settings in a *.ims file, close SetupIML and run DDE Panel or Logger
*
Windmill DDE Panel
- From the File menu select Load Hardware Setup and choose the *.ims file you just saved.
- Connect your channels. You should see your data in DDE Panel.
- Proceed similarly for the Logger programs.
*
Getting the data into Excel
You can use the Windmill Logger program to collect data, and after collection has finished import it into Excel. Alternatively, you can collect data with Excel in real-time by writing an Excel macro to read data from the Windmill DDE Panel. For more details see our Excel page at https://www.windmill.co.uk/excel/
*
Trouble-Shooting
If you are having problems receiving data from your Sylvac gauge, right-click the LabIML icon on the tool bar and select "Debug Options".
If the LabIML Debug window says "Parsing Failed", go back to the ConfIML window and edit your Reply Parse String.
Note that with an RS232 connection Windmill can collect data at speeds of up to 5 readings per second, or one reading every 0.2 seconds. Don't try to run Windmill any faster otherwise you may inadvertently slow the system down. If you have problems when running Windmill at its fastest:
- Turn off any alarms set with SetupIML
- In Logger, choose not to display data on screen.
- Close any programs that you are not currently using.
If you are still having trouble fill in the form at https://www.windmill.co.uk/techsupp.html
*
Further Reading
Using Windmill with a Sylvac Dial Gauge
https://www.windmill.co.uk/sylvac.html
USB-Serial Converters
https://www.windmill.co.uk/usb-serial.html
Our thanks to Peter Rosenbeck of Linak A/S for making the pdf guide available at https://www.windmill.co.uk/sylvac.pdf.
Excel Corner: Working with Collections of Data
Excel has a little-used feature that provides great flexibility when analysing tables of data. It is called an Array Formula.
You can use an array formula
- To return several values
- To apply a function only to values matching your conditions.
- To perform calculations on values matching two or more criteria
An array formula is special in Excel: to enter it you press the Ctrl, Shift and Enter keys together on the keyboard. You must do this even after you edit the formula. If the array formula has been entered properly curly braces appear around it. (You cannot type the braces manually.)
An array formula acts on two or more sets of values known as array arguments. It is made up of normal Excel functions, which is why you must press the CTRL+SHIFT+ENTER keys to tell Excel that this is an array formula.
Here are some examples of array formulas that you should be able to adjust for your own data.
You can download an Excel spreadsheet containing examples of array formulas from https://www.windmill.co.uk/excel/array.xls
*
To find the three largest values in a range
An array formula can return several values at once. This is often quicker than entering a normal function several times in a spreadsheet, and reduces workbook size.
- Select a group of three cells to hold the results of the calculation.
- Enter the formula =LARGE(E7:E67,{1;2;3}) then press CTRL+SHIFT+ENTER
You must always select the cells to hold the results first. The formula will be copied into each cell you select.
How it Works...
- The LARGE function returns the xth largest number in a set of data. If you enter it as an array formula, you can specify an array of positions to be returned. In our example we have specified that we want the first, second and third largest numbers.
- It returns an array, so we could use it with, say, the
average function to average the top three numbers:
=AVERAGE(LARGE(E7:E67,{1;2;3})) - We could achieve the average without using an array formula. But with an array formula we can do it using just one cell.
*
To Average Only Values Over 5 in the Range D7 to D27
Enter the formula =AVERAGE(IF(D7:D27>5,D7:D27)) then press CTRL+SHIFT+ENTER
How it Works...
- The first part of the IF statement - that is the first
array argument - checks whether each value in the range
D7 to D27 is greater than 5. It stores the results in an
array in memory: storing a value if the condition is met
and "FALSE" if it is not. To see what Excel is doing,
highlight the IF statement - (IF(D7:D27>5,D7:D27) - and
press the F9 key. You'll see something like this
{7;6;6;6;6;7;6;6;7;6;7;6;FALSE;FALSE;FALSE;FALSE;FALSE} - The second part of the IF statement - the second array
argument - specifies the location of the values to be
stored. In this case we are storing the values which
were checked to see if they were over 5. However, you
could check values in column F, say, but average the
corresponding values in Column E with
=AVERAGE(IF(D7:D27>5,E7:E27)) - AVERAGE is a normal Excel function which takes an array of numbers and returns their average value, eg =AVERAGE(1,2,3) equals 2. It ignores any text or logical values (TRUE or FALSE). Here the array stored in memory by the IF statement is being averaged.
- IF evaluates a condition and returns one value if the condition is TRUE and another if the condition is FALSE. It has the format IF(test,value_if_true,value_if_false). If you don't specify what value to return, it will return TRUE or FALSE as appropriate. In our example - IF(D7:D27>6,D7:D27) - we have instructed IF to return a value in the range D7 to D27 (the second array argument) if the condition is true. We haven't specified what to do if the condition is false and so IF will return "FALSE", which the AVERAGE function will ignore.
*
To count the number of times temperature was over 0 oC AND humidity below 50%
If temperature is in cells B7:B67, and humidity is in
cells C7:C67, enter
=COUNT(IF((B7:B67>0)*(C7:C67<50),C7:C67))
then press
CTRL+SHIFT+ENTER
How it Works...
- This time we are using a COUNT function. This counts the number of cells that contain numbers. It will ignore any text or "TRUE" or "FALSE" conditions. This means we can again use it with an IF function.
- In this example we want two conditions to be true: (B7:B67>0) and (C7:C67<50). Multiplying the results of the two tests together means that if one of the conditions was false, a "FALSE" value will be stored in the array and the result will not be counted.
- The second array argument, C7:C67, specifies the value to store if the conditions are true. This could equally be the temperature range of B7:B67. The actual values stored doesn't matter: the COUNT function is only counting the number of values which aren't false and using either range will work. (See point 4 above.)
*
To count the number of times temperature was over 0 oC OR humidity below 50%
If temperature is in cells B7:B67, and humidity is in
cells C7:C67, enter
=COUNT(IF((B7:B67>0)+(C7:C67<50),C7:C67)) then press
CTRL+SHIFT+ENTER
How it Works...
- It works as the previous example, but instead of multiplying the two tests together we add them together. This is because adding a FALSE value to a number results in the number. (Try it in an Excel sheet. You will find that =3+FALSE equals 3.) This means that a + results in an OR condition.
*
Error Messages you may Receive, and the Solutions
- "#VALUE"
- Make sure you have pressed CTRL+SHIFT+ENTER to enter your array formula
- "You cannot change part of an array"
-
- This message occurs when you try to delete or copy only one of the results of a multi-result array formula. Instead select all the results then delete or copy.
- It also appears if you try to edit a multi-result array formula and forget to press CTRL+SHIFT+ENTER afterwards.
Note: Array formulas returning a single reading may slow a spreadsheet down. If one of the cells referenced in the formula changes, all the cells referenced will be recalculated. Don't reference bigger ranges than you need.
Further Reading
For more tips on using Excel for data acquisition and analysis see https://www.windmill.co.uk/excel/ and https://www.windmill.co.uk/excel/excel-charting.html
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 news on your own web site, read it via e-mail, mobile phone or a newsfeed viewer.
Sensor detects when fruit are ripe
Ripe apples next to bananas? Not a good idea. Bananas
give off a lot of ethylene, which causes the apples
to ripen quickly. Wholesalers make use of this,
actively regulating the ethylene concentration in
fruit warehouses. A new sensor can now measure the
ethylene concentration accurately at a low cost.
Source: Fraunhofer IPM
http://www.ipm.fraunhofer.de/
Robotic sea glider flies through water
Researchers have successfully flown the first
environmentally powered robotic vehicle through the
ocean. The new robotic "glider" harvests heat energy
from the ocean to propel itself across thousands of
kilometers of water. The gliders can carry a variety
of sensors to collect measurements such as temperature,
salinity, and biological productivity. Gliders also
operate quietly, which makes them ideal for
acoustic studies.
Source: SCUBA News
http://news.scubatravel.co.uk/
Getting the measure of waves
Wave energy converters could be made more efficient
with a device that measures the size of each wave
approaching the converter. Scientists at Edinburgh
University are investigating ribbon-shaped sensors to
provide real-time, 3D mapping of the wave field. The
technology consists of a box that sends light down the
ribbon and receives light back at the same time. Wave
height is indicated by measuring the light lost, and
the greater the amount lost, the higher the curvature
of the wave.
Source: The Engineer Online
https://www.theengineer.co.uk/
Robotic minds think alike?
Most schoolchildren struggle to learn geometry, but
they are still able to catch a ball without first
calculating its parabola. Why should robots be any
different? A team of European researchers have
developed an artificial cognitive system that learns
from experience and observation rather than relying
on predefined rules and models.
Source: CORDIS
http://cordis.europa.eu/
* 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 other publication, providing the above notice
is included and a link back to our website is in place.
For previous issues by subject see https://www.windmill.co.uk/monitorindex.html
DOWNLOAD DATA ACQUISITION SOFTWARE
As a thank you for subscribing we offer you the ComDebug data logging and Com port trouble-shooting software. Log data over RS232, RS422, RS485 or Modbus. Also included is a month's trial of the Windmill 7 logging, charting and control programs.
SUBSCRIBING OR CANCELLING SUBSCRIPTION Visit https://www.windmill.co.uk/newsletter.html and add or remove your e-mail address.
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/