-------------------------Monitor------------------------ The Newsletter for PC-Based Data Acquisition and Control Issue 117 www.windmill.co.uk April 2008 --------------------ISSN 1472-0221---------------------- Welcome to Monitor. This month: receiving e-mails whenever a measurement crosses its alarm level - see the Excel Corner for details. Plus how to use your PC to collect data from a Transcell digital indicator. 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: Interfacing a Transcell Digital Indicator * Excel Corner: E-mailing Alarm Alerts * DAQ News Roundup * Data Acquisition and Control Exhibitions ________________________________________________________ ________________________________________________________ Windmill Notes: Interfacing a Transcell Digital Indicator ________________________________________________________ Windmill software lets you interface Transcell digital indicators, and other instruments with an RS232 serial port, to a PC running Windows. To do this you need one of our serial drivers: COMIML or LabIML. Windmill COMIML software is very easy to use and you can try before you buy. Alternatively, subscribers to Monitor can download the earlier LabIML for free. Windmill automatically feeds data from the Transcell indicator to Windows application software like Excel. The package also includes data logging, charting and output control software. These are ready-to-run applications: no programming is required. A Transcell Digital Indicator shows weight measurements from load cells. It requires a null modem RS232 cable. Configuring the Free Windmill Software for a Transcell Indicator ================================================================ There are three basic steps to setting Windmill to log data from a Transcell display. 1. Run the Windmill ConfIML program and enter your Transcell's communication settings. 2. Run the Windmill SetupIML program and choose names and units for your display's data. 3. Run the Windmill DDE Panel, Logger or Chart program, or Excel, to save or display data from your display. After you have entered your configuration settings with ConfIML and SetupIML, you don't need to use these again and can go straight to the logging and display programs. More details on entering the configuration settings are below. * Windmill ConfIML This programs detects and saves a record of the hardware you want to use. 1. Start ConfIML and Press the Add button. 2. Select LabIML RS232 ASCII Instrument Handler. 3. Type a name for the Transcell and a description. The name and description can be anything you like. Enter 1 as the number of channels if you are collecting data from one load cell. 4. Enter your instrument's settings. What you enter here depends on how you have configured your Transcell indicator. - Reading Protocol: This depends on your Transcell User Menu setting (A3). If you have selected Simplex then choose Continuous Flow as the Reading Protocol. If you have selected Full Duplex, choose Request/Response On Demand. - Timeout: 5000 - Instrument Idle or Wait Time: 0 - Returned Message Length: For Request/Response on Demand, use 20; for Continuous Flow, use 18 - Instrument Initialisation String: Leave blank. 5. Click the Channels button and define how to extract data. consult your Transcell Manual (http://www.transcell.net/) for details of the commands to send, and the format of the display's reply. If you can't find this information use the settings below. - Make sure that Read channel is checked - Enter the engineering units your gauge uses, eg kg - Ignore the maximum and minimum settings: these are just a guide for chart scaling etc. - Prompt string: P (not needed with Continuous Flow) - Parse String, Simplex Mode (Continuous Flow): When in Simplex mode, the Transcell returns a message like this
xxxxx.xxKG where indicates the start of the message. This is non-printing character decimal 002. is either a space for positive or - for negative xxxxx.xx is the weight K means kilograms (or L for pounds) G means gross weight (N for net weight) is the status - space for Valid, M for motion, O for over- or under-range is a carriage return is a line feed To extract the weight from this message you could search for the start of message (decimal 002), ignore 1 character and extract the next 9 characters. This appears as \S"\C002"\I01\E09 - Parse String, Duplex mode (Request/Response On Demand) When in Duplex mode, the Transcell returns a message like this xxxxx.xx KG GR where KG means kilogram (or lb for pounds) GR means gross (or NT for net) Rest as in Simplex mode Here you could again search for the start of message (decimal 002), ignore 1 character and extract the next 9 characters: \S"\C002"\I01\E09 - Initialisation string and Acknowledge string: Leave blank. 6. Enter your communication settings. These depend upon your User Menu settings in the Transcell Indicator. - Com port: The port to which you have connected your Transcell. - Baud rate: As you specified for your Transcell with the User Menu (A1). - Data bits: As you specified for your Transcell with the User Menu (A2). If in doubt try 8 bits and no parity (Transcell 8n). - Parity: As you specified for your Transcell with the User Menu (A2). For 8 data bits the parity is always none. For 7 data bits, parity might be odd, even or none (Transcell 7O, 7E, 7n). - Flow control: None. 7. Save your settings, close ConfIML and start SetupIML. * Windmill SetupIML Here you can name your channel, set its units, alarms and so on. 1. Choose to Create a New Setup and enter a name and description. This can be anything you like. 2. From the Device menu select LabIML. 3. Your data channels will be shown as a number like 10000. Double click this. 4. Type name for your channel, eg Weight and make sure Enable for Input is checked. 5. Save your settings in a *.ims file, close SetupIML and run DDE Panel or Logger * Windmill DDE Panel 1. From the File menu select Load Hardware Setup and choose the *.ims file you just saved. 2. Connect your Transcell channels. You should see your data 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 by using 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, right- click the LabIML icon on the tool bar and select "Debug Options". If the LabIML Debug window says "Parsing Failed", you have not properly defined how to extract your data. Go back to the ConfIML window and adjust your Reply Parse String. If the LabIML Debug window shows no incoming data at all, you may have a cabling problem. The Trancell is a DTE type instrument and requires a null modem RS232 cable. See Trouble-Shooting Serial Port Connections at https://www.windmill.co.uk/rs232-communication.html for more details. Check also whether you have connected the Transcell in Simplex (continuous flow) or Duplex (Request/Response) mode. For the TI-1500 and TI-1600 If you have used the COM1 port on the Transcell it will be in Duplex mode, and if you have used the Transcell's COM2 port it will be in Simplex mode. * Further Reading =============== Interfacing a Transcell Digital Indicator https://www.windmill.co.uk/transcell.html Transcell Manuals http://www.transcell.net/ _______________________________________________________ ________________________________________________________ Excel Corner: Excel Corner: E-mailing Alarm Alerts ________________________________________________________ One of our readers is collecting live temperature data in Excel. He asked us how he could get Excel to send him an e-mail whenever the temperature exceeded a given level. To do this you need to: 1. Collect the live data. 2. Detect when the data changes. 3. Test whether the watched value exceeds its alarm level. 4. If so send the e-mail. These tasks are accomplished by four macros. You can download a spreadsheet with examples of these macros from https://www.windmill.co.uk/excel/sendemail2.xls 1. Collect the Live Data ======================== Although you can normally collect live data simply by copying and pasting a link from the Windmill DDE Panel, this will not work for our purpose. The data will be displayed and automatically update, but the formula behind the data remains the same. This means that Excel will see the cell contents as unchanging and will not know when the data value has updated. Instead use the macro given in https://www.windmill.co.uk/excel/sendemail2.xls. For more details about collecting live data in Excel see https://www.windmill.co.uk/excel/ 2. Detect when the Value Changes ================================ To do this we can use one of Excel's worksheet event procedures: Private Sub Worksheet_Change. You must enter this as a private macro. To do this right-click the Sheet name tab, choose View Code and enter your macro. If you were collecting live data in cell A2 then the following code would detect when this live data changed, and if so would run the macro "TestCondition". Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$2" Then TestCondition End Sub The macro runs everytime the worksheet changes. Target is a predefined variable which represents the location of the cell or range in which you are interested. When a change occurs the macro checks whether the target data changed, and if so runs the specified macro (TestCondition). 3. Test whether this Changed Value Exceeds its Alarm Level ========================================================== This is a simple macro to test whether the data value in cell A2 exceeds the alarm level entered in cell A1. If so then the SendEmail macro runs. Sub TestCondition() If ActiveSheet.Range("A2") > ActiveSheet.Range("A1") Then SendEmail End Sub 4. Sending an E-mail ==================== The SendMail Method sends an Excel Workbook as an attachment to specified recipients. Sub SendEmail() ActiveWorkbook.SendMail Recipients:="[email protected]", Subject:="Temperature Too High" End Sub This will send the active workbook containing the data to [email protected] You cannot send text in the body of the message or attach files other than an Excel workbook. When you run the macro you may get a message from your e-mail client saying "A program is attempting to send an e-mail on your behalf. Do you wish to send the e-mail?". You need to disable this in the Security settings of your e-mail client (Outlook for example), and then restart Excel. You also need to set your e-mail client to send messages immediately and not to wait until the Send button is pressed. Further Reading =============== For how to change the e-mail address from which the e-mail is sent, see Issue 118 of Monitor. 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. Cool Microsensors Offer Improved Analysis Researchers at the National Institute of Standards and Technology (NIST) have combined two tiny but powerful NIST inventions on a single microchip, a cryogenic sensor and a microrefrigerator. The combination offers the possibility of cheaper, simpler and faster precision analysis of materials such as semiconductors and stardust. Source: National Institute of Standards and Technology https://www.nist.gov/ Self-Powered Tyre Sensors Morgan Electro Ceramic, has developed technology which can power car tyre pressure monitoring systems (TPMS) using wheel movement instead of batteries. The device, a piezoelectric bimorph, enables TPMS manufacturers to design self-powered remote sensors that accurately measure tyre pressure, with none of the lifetime and disposal issues associated with batteries. Source: Morgan Electro Ceramics http://www.morgancrucible.com/ Robotic Jellyfish Swim and Fly at Hannover Fair The biggest draws at Festo's Hannover Fair exhibits have been biologically inspired robotic creatures that show off cutting-edge automation technologies. Turning once again to nature for inspiration, the company's engineers this year came up with robotic jellyfish that either swim or fly. AquaJelly robots also manage their own battery-charging behavior. They communicate with an in-tank charging dock wirelessly via ZigBee, for example, to make sure the dock isn't occupied when they need to charge. Source: Design News http://www.designnews.com/article/CA6553745.html Wireless for Process Manufacturing Growing at 32% The market for wireless devices and equipment in process manufacturing will grow at 32% per year to 2012, according to a new ARC Advisory Group study. Wireless process sensing is expected to be the fastest growing market segment as the market absorbs a deluge of new wireless sensing products that comply with wireless versions of industrial standards. Source: ARC Advisory Group http://www.arcweb.com/ ________________________________________________________ ________________________________________________________ Data Acquisition and Control Exhibitions ________________________________________________________ Every four months we list the exhibitions around the world related to data acquisition and control. Nepcon 29 April - 1 May 2008 Birmingham UK The UK's complete production line event for the electronics industry. It encompasses all aspects of the electronics manufacturing process, from design to production and test. http://www.nepcon.co.uk/ Aimex 3-8 May 2008 Seoul Korea Industrial automation, instrumentation and measurement exhibition. http://www.aimex.co.kr/2008/eng/main.asp Automation Vietnam 2008 8-10 May 2008 Hanoi Vietnam International factory automation, electrical and power transmission and material handling technology exhibition and conference. http://www.automationvietnam.com/ ESEC : Embedded Systems Expo 14-16 May 2008 Tokyo Japan The largest embedded systems exhibtiion in Asia. http://www.esec.jp/en/ National Manufacturing Week 27-30 May 2008 Sydney Australia Serves the automation, process, electronics and electrical industries. http://www.nationalmanufacturingweek.com.au/ SIEE - Pollutec 19-22 June 2008 Algiers Algeria International exhibition of equipment and services for water. http://www.siee-pollutec.com/ DMS 25-27 June 2008 Tokyo Japan Design engineering and manufacturing solutions expo. http://www.dms-tokyo.jp/english/ ________________________________________________________ ________________________________________________________ * 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/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] https://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.
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 [email protected] If you have problems contact the Editor.