-------------------------Monitor------------------------ The Newsletter for PC-Based Data Acquisition and Control Issue 84 www.windmill.co.uk July 2005 --------------------ISSN 1472-0221---------------------- Welcome to July's edition of Monitor. We hope you find the newsletter useful, but should you wish to cancel your subscription you can do so at http://www.windmill.co.uk/newsletter.html CONTENTS ======== * Windmill Notes: Interfacing Mettler Toledo and Other Electronic Balances * Spreadsheet Corner: Using OpenOffice with Windmill ________________________________________________________ ________________________________________________________ Windmill Notes: Interfacing Mettler Toledo and Other Electronic Balances ________________________________________________________ Windmill software lets you interface Mettler Toledo and other balances to a PC running Windows. To do this you need a serial driver. We offer a choice of two. The latest, Windmill 6 COMIML, is the easiest to use and you can download a free version to check that it will read data from your balance (http://www.windmillsoft.com/daqshop/rs232-modbus.html). Alternatively, subscribers can download an earlier version of the driver (LabIML 4.3) which will also save data. There are three basic steps to getting data from your balance. 1. Run the Windmill ConfIML program (Windmill 4.3) or ComDebug (Windmill 6) and enter your balance's communication settings. 2. Run the Windmill SetupIML program and choose a name and units for your balance's data. 3. Run the Windmill DDE Panel, Logger or Chart program to save or display data from your balance. After you have entered your configuration settings with ConfIML (or ComDebug) and SetupIML, you don't need to use these again and can go straight to the logging and display programs. * Run the Windmill ConfIML or ComDebug program ============================================ This detects and saves a record of the balance you want to use. Windmill 4.3: ConfIML --------------------- In ConfIML you need to add the LabIML ASCII instrument handler and enter your instrument's communication settings. To do this Press the Add button. 1. Select LabIML RS232 ASCII Instrument Handler. 2. Type a name for the balance and a description. The name and description can be anything you like. You will generally enter 1 as the number of channels. (Each channel holds one type of data item: in this case weight is usually the only value being measured.) Press OK. 3. Enter your instrument's settings. These should work for Mettler Toledo balances: Reading Protocol: Request/Response On Demand Timeout: 5000 Instrument Idle or Wait Time: 0 Returned Message Length: Count how many characters are in the balance's message - you should find this information in the balance's "Data Interface Operating Instructions". If not set to 20. Instrument Initialisation String: Leave blank. 4. Extracting Data You now need to define how to extract data. In ConfIML press the Channels button. Your settings here depend upon how you have configured your balance. Enter a command or prompt string to send to the balance to ask for data, then enter parsing instructions to extract the data value from the balance's reply. Check your balance's Interface Operating Instructions for details of the commands to send, and the format of the balance's reply. For example, to request a single stable value you would set... Prompt String: S followed by a Carriage Return and a Line Feed. This looks like S\C013\C010 To extract data from the balances reply you might use... The reply might look like this: S S 100.0 g. In which case you could ignore everything until a number occurs and then extract everything until the next space. Your parse string would look like:
\I"0123456789"\E" " 5. The next step is to enter your communications settings. These should be the same as those used by the balance: check the Mettler "Data Interface Operating Instructions" for your model. If in doubt start with 9600 baud, 8 data bits, no parity, 1 stop bit and no flow control. 6. Save your settings. Windmill 6: ComDebug -------------------- 1. Select "Create a New Instrument File" (or, if you haven't purchased the COMIML driver, select "Use the program as a Terminal Utility"). 2. Select "Edit COM Port Settings". These should be the same as those used by the balance: check the Mettler "Data Interface Operating Instructions" for your model. If in doubt start with 9600 baud, 8 data bits, no parity, 1 stop bit and no flow control. 3. Select "Add a New Message" to bring up the Terminal screen. In the Prompt grid type your command string as detailed in point 4 above. 4. Press the Send button. If all is well the instrumentĘs reply is shown in the Reply grid. 5. You now need to extract data from the reply. Press the Parse button and use the Add Action button to pinpoint the location of the data in the reply. To obtain the data use the Extract menu. * Run the Windmill SetupIML program (Versions 6 and 4.3) ====================================================== Here you can name your channel of data, set its units, any alarms and so on. 1. From the Device menu select LabIML (or COMIML). 2. Your data channel will be shown as a number like 10000. Double click this channel. 3. Type name for your channel and make sure Enable for Input is checked. If you want to change the units enter an appropriate scale and offset. For example, if you wanted to convert milligrams to grams you'd enter 1000 as the scale and 0 as the offset. 4. Save your settings in a *.ims file and close SetupIML. * Open Windmill DDE Panel, Logger or Chart ======================================== 1. From the File menu select Load Hardware Setup and choose the *.ims file you just saved. 2. Connect your weight channel. You should see the correct weight in DDE Panel. 3. Proceed similarly for the Logger and Chart 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. For more details see http://www.windmill.co.uk/excel/. It isn't just Excel you can use, data collected by Windmill can be fed into most spreadsheet or analysis programs. For example the OpenOffice spreadsheet detailed below. * Further Reading =============== Mettler Toledo Bidirectional Data Interface Operating Instructions These describe in detail the commands and settings available with the Mettler Toledo balances. http://www.mt.com/ Interfacing a Mettler Toledo Balance http://www.windmill.co.uk/mettler.html ________________________________________________________ ________________________________________________________ Spreadsheet Corner: OpenOffice ________________________________________________________ I've renamed the Excel Corner this month, as it's about an alternative spreadsheet: OpenOffice. OpenOffice is an open-source office suite and therefore free! You can open the data files saved by Windmill Logger in OpenOffice like this... 1. In the OpenOffice spreadsheet, choose File - Open. 2. In the "Files of Type" box, select Text CSV. 3. In the File name box type *.wl and click the Open button. Your saved Logger data files are shown. Select one and clickOpen. 4. You will see the Text Import dialogue. Click OK. 5. The logged file is shown with the data lined up in the appropriate columns. Seeing Live Data in OpenOffice ============================== The Windmill DDE Panel lets you copy and paste live data into OpenOffice. Just press the Copy to Clipboard button in the DDE Panel and choose the type of information you want to copy: data values, channel names, data units, alarm settings, etc. Move to OpenOffice, select Paste Special from the Edit menu and choose to paste as a link. The data in OpenOffice will continually update. OpenOffice Functions ==================== Many of the functions of Excel are also available in OpenOffice. For instance, in Issue 36 of Monitor (http://www.windmill.co.uk/monitor36.html) we explained how to hide superfluous data using Excel's autofilter. A similar autofilter tool is also available on OpenOffice's Data menu. Issue 44 (http://www.windmill.co.uk/monitor44.html) described how to find when the largest data value was logged. We used Excel's Match, Max and Index functions, all of which are available in OpenOffice. However, we specified a column of data by using B:B. In OpenOffice you would use either named ranges or the cell references - B1:B100 for example. You would also use semi-colons in functions rather than commas. So the INDEX(A:A,MATCH(MAX(B:B),B:B,0),1) function described for Excel becomes INDEX(A1:A100;MATCH(MAX(B1:B100);B1:B100;0);1) in OpenOffice. You can download OpenOffice from http://www.openoffice.org/ ________________________________________________________ ________________________________________________________ * Copyright Windmill Software Ltd * Reprinting permitted with this notice included * For more articles see http://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 http://www.windmill.co.uk/newsletter.html and an index of articles at http://www.windmill.co.uk/newsletter.html 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] http://www.windmill.co.uk/ http://www.windmillsoft.com/
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.