-------------------------Monitor------------------------ The Newsletter for PC-Based Data Acquisition and Control Issue 85 www.windmill.co.uk August 2005 --------------------ISSN 1472-0221---------------------- Welcome to 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 a Parallax BS2-IC BASIC Stamp * Spreadsheet Corner: DDE and OpenOffice * Data Acquisition and Control Exhibitions ________________________________________________________ ________________________________________________________ Windmill Notes: Interfacing a Parallax BS2-IC BASIC Stamp ________________________________________________________ The BASIC Stamp is noted for the ease it has brought to resolving control technology problems. Its use of the BASIC language with inbuilt control instructions can dramatically shorten industrial development time. The Windmill software can read ASCII data and you can configure it to pass readings directly to an application like Excel. The BS2-IC debug statement is additionally useful here because it makes it easy to format ASCII data in a manner that's applicable to both Windmill's and Excel's requirements. Exploiting the situation to the full turns the BS2-IC into a Windmill multi-channel datalogging instrument. To use Windmill to collect data from the Stamp you need one of our serial drivers. The latest, Windmill 6 COMIML, is the easiest to use (https://www.windmillsoft.com/daqshop/rs232-modbus.html). Alternatively, you can download an earlier version of the driver (LabIML 4.3) for free. This version will also regularly save data for you. There are three basic steps to setting up data collection. 1. Run the Windmill ConfIML program (Windmill 4.3) or ComDebug (Windmill 6) and enter the stamp's communication settings. 2. Run the Windmill SetupIML program and choose a name and units for your data. 3. Run the Windmill DDE Panel, Logger or Chart program to save or display data from your hardware. 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 hardware 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 Stamp, a description and enter how many channels of data you will be collecting. The name and description can be anything you like. Each channel holds one type of data item: for example temperature measurements. Press OK. 3. Enter your instrument's settings. If your Stamp program regularly sends data, these settings should work: Reading Protocol: Continuous Timeout: 10000 Instrument Idle or Wait Time: 0 Returned Message Length: Count how many characters are in the Stamp's message - this depends on your Stamp's program. Instrument Initialisation String: Leave blank. 4. Extracting Data You now need to define how to extract data. In ConfIML press the Channels button. What you enter here depends on your Stamp program. Let's assume that the BS2-IC produces an output of ASCII strings that range from "-55.0" to "+120.0" with a leading sign character, a trailing carriage return to mark the end of data and a maximum length of seven characters. In this case to extract the data you could ignore characters until meeting a "+" or "-", then extract everything until the carriage return. This looks like: \I"+-"\E"\C013" 5. The next step is to enter your communications settings. Baud rate: 9600 Data bits: 8 Parity: none Flow control: none. 6. Save your settings. * Run the Windmill SetupIML program ================================= Here you can name your channel of data, set their units, any alarms and so on. 1. From the Device menu select LabIML (or COMIML for Version 6). 2. Your data channels will be shown as a numbers like this: 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, to convert Celcius to Farhenheit you would set 1.8 as the scale and 32 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 channels. You should see the updating data values in DDE Panel, Logger or Chart. * 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 =============== Interfacing a Parallax BS2-IC BASIC Stamp http://www.windmill.co.uk/stamp.html Application Example: Teaching Technology http://www.windmill.co.uk/ostec.html For Basic Stamp documentation see http://www.parallax.com/html_pages/downloads/basicstamps/documentation_basic_stamp.asp ________________________________________________________ ________________________________________________________ Spreadsheet Corner: OpenOffice ________________________________________________________ Following our article last month on the OpenOffice spreadsheet, here we take things a step further and give an example of a simple macro to read live data and store it in OpenOffice. OpenOffice is a free spreadsheet that runs under Windows. Using Macros for Analysis and Control with OpenOffice ===================================================== This is a simple example of how a macro can read data from one channel connected to the Windmill DDE Panel, and place it into a cell in the OpenOffice spreadsheet 1. Load Windmill DDE Panel and start collecting data from your instrument. 2. Load OpenOffice with a clean sheet, and then select menu item Tools.Macros.Macro. 3. Click the Edit button. 4. Paste the following code. Sub Main ' Opens a DDE conversation with the Windmill DDE ' Panel using the Service Name "Windmill" and the ' Topic Name "Data" ddeChan = DDEInitiate("Windmill", "data") ' Requests data from a channel called Tank_Temp. myData = DDERequest(ddeChan, "Tank_Temp") oCellRange = ThisComponent.Sheets.Sheet1.getCellRangeByName("A1") ThisComponent.CurrentController.Select(oCellRange) ThisComponent.CurrentSelection.FormulaLocal = myData ' Closes the DDE conversation. DDETerminate (ddeChan) End Sub For more on using OpenOffice with Windmill see http://www.windmill.co.uk/openoffice.html To download a free copy of OpenOffice go to http://www.openoffice.org/ ________________________________________________________ ________________________________________________________ Data Acquisition Exhibitions and Conferences ________________________________________________________ Here are the next set of exhibitions dedicated to data acquisition and control. AUTOMAATIO Helsinki Finland 6-8 September One of the foremost automation fairs in Northern Europe. Sectors covered include: process automation, remote systems, automation engineering and information systems in industry. http://www.finnexpo.fi/ MICONEX Shanghai China 15-18 September International fair for measurement, instrumentation and automation. http://www.miconex.com.cn/manager/English/aboutus.html IRCHEM Dublin Ireland 20-22 September For all those involved in the chemical, pharmaceutical, processing and medical devices industries. Content includes production equipment, instrumentation, environmental management systems, automation systems, safety equipment, packaging and handling technology. http://www.irchem.com/ Interkarma India Delhi India 1-3 October International trade fair for industrial automation. http://www.interkama-india.com/ Instrumentation South Reading UK 5-6 October Covers all aspects of the uses in industry of test, measurement, data acquisition and control. http://www.instrumentation.co.uk/sthabout.html ISA Expo Chicago USA 25-27 October The premier automation and control conference and exhibition in North America. Featuring analytical equipment, test and measurement instruments, industrial networks, control systems, and so on. https://www.isa.org/rd.cfm?id=5882 Design Engineering Show Birmingham UK 4-6 October Claims to provide everything to enable a company to specify, design, engineer, make and test new product designs http://www.des-show.co.uk/ Smart Automation Austria Linz Ustria 5-7 October Trade fair for industrial automation. http://www.smart-automation.at/ Scanautomatic Stockholm Sweden 18-21 October Industrial automation exhibition held every two years. http://www.scanautomatic.com/ Automation Fair St Louis USA 16-17 November Focuses on advanced automation products, integrated control and information architecture, valued-add services and solutions. http://www.automationfair.com/ ________________________________________________________ ________________________________________________________ * 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/ https://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.