28 May 2012 |
-------------------------Monitor------------------------ The Newsletter for PC-Based Data Acquisition and Control Issue 166 www.windmill.co.uk May 2012 --------------------ISSN 1472-0221---------------------- Thanks for subscribing to Monitor. If you want to try our free data acquisition software subscribers can download it for free. I hope enjoy the newsletter, but should you wish to remove yourself from our mailing please go to Monitor Newsletter CONTENTS ======== * Windmill News: Interfacing an Adam 4018 Thermocouple Input Module * COM port settings * Excel Corner: Closing All Open Worksheets * DAQ News Round-up ________________________________________________________ ________________________________________________________ Windmill Notes: Interfacing an Adam 4018 Thermocouple Input Module ________________________________________________________ The latest addition to the list of instruments interfaced by Windmill, is the Adam 4018 Thermocouple Input Module from Advantec. You can use an RS485 to RS232 converter to connect the module to the computer. To log and chart data from the Adam 4018, download Windmill and enter these settings. COM Port Settings: Baud Rate: 9600 Data Bits: 8 Parity: None Stop Bits: 1 Flow Control: None Data Format: Prompt String: #000<CR> This command asks for analogue input data from module address 00, channel 0, where <CR> is a carriage return. Example data string: The module will send back a reply in the format >+026.60<CR> To extract just the reading, including the +/- sign, use Ignore Until +- Extract Until <CR> Instrument Timings: Read: Directly Timeout: 5000 ms Instrument Idle or Wait Time: 500 ms Data Persistence Time: 5000 ms For more information see https://www.windmill.co.uk/driver-adam-advantech.html For how to use Windmill with other serialinstruments see https://www.windmill.co.uk/serial_driver.html For more on RS232 connections see below and https://www.windmill.co.uk/rs232-communication.html https://www.windmill.co.uk/handshaking.html ________________________________________________________ ________________________________________________________ Making Measurements through the COM Port ________________________________________________________ You can connect many different types of industrial and scientific instruments to computers via their COM ports. Doing so lets you automatically transfer data directly into logging, charting, spreadsheet, database and other display and analysis programs. To achieve this you need some driver software to read the data arriving at the port. You can download a free trial of Windmill software. When using any serial driver you will need to tell the software about the communication settings used by your instrument. These include COM port number, baud rate, parity, data bits and stop bits. * Most Common Settings The most commonly used settings for serial devices are... Data Bits: 8 Parity: None Stop Bit: 1 Flow Control: None Read on for an explanation of these and other COM port terms. * COM Port Number You need to tell the software into which port you have plugged your instrument. If your computer does not have any COM ports, or you have more devices than you have ports, you can easily add a USB-serial adaptor (more details at https://www.windmill.co.uk/usb-serial.html). * Baud Rate In serial communications - such as through the COM port - messages are sent 1 bit after another. The baud rate specifies how frequently the bits are sent. The instrument and the computer must both communicate at the same rate. The driver software will always offer a choice of baud rates: pick the one matching your instrument's. If you can select the baud rate of your instrument it is best to choose a fast rate. This reduces the transmission times when s ending and receiving messages. If the instrument is a long way from the computer and transmissions are unreliable, you may need to use a lower baud rate. No matter how fast your connection - the maximum number of instrument readings per second depends on the software. * Data Bits The stream of bits received at the COM port is interpreted in groups of (usually) 7 or 8 bits. Each group represents a piece of information. It is obviously important that the instrument and the computer concur on the number of data bits in a group. You will have to consult your instrument's manual to find out how many data bits it uses. If you are unsure, set the driver software to the more commonly used 8 data bits. * Parity Parity is the state of being either odd or even. In serial communications parity may be used to check for errors in the transmission of data. When performing a parity check, the instrument or PC sending messages counts the number of 1's in a group of data bits. Depending on the result, the value of another bit - the Parity Bit - is set. The device receiving the data also counts the 1's and checks whether the Parity Bit is as it should be. To perform a parity check the computer and the instrument must obviously agree on how they are calculating the Parity Bit. Are they setting it on for an even or odd number of 1's? When a device uses Even Parity, the data bits and the parity bit will always contain an even number of 1's. The reverse is true for Odd Parity. For example, when Odd Parity is operating and the data bits contain 10010110 - we have four 1's so the parity bit will be on (set to 1) to make an odd number. Two other parity options often available in driver software are Mark and Space. These aren't effective in error checking. Mark means the device always sets the Parity Bit to 1 and Space always to 0. Parity is a rudimentary error checking mechanism. It can detect an error in transmitting 1 bit, but if 2 bits happened to be wrong it would not pick this up. It also provides no help as to which bit is wrong. Other error checking mechanisms include the Start and Stop Bits described below, and cyclic redundancy checks which are often used in Modbus communications. Consult your instrument's manual to determine its parity settings - if in doubt start by setting parity to "none". No Parity Bit will be sent. * Start and Stop Bits Communication through the COM port is asynchronous. This means that data is sent intermittently and not at predetermined intervals. A device must therefore be able to determine the start and end of a message. It accomplishes this by Start and Stop Bits. The start bit precedes the data bits. The stop bit follows either the parity bit if present, or the data bits. The data line has two states - on and off. An idle line is always on. When the instrument or computer wants to send data it sets the line to off - this is the Start Bit. The bits immediately after the start bit are therefore the data bits. The Stop Bit is present to allow the instrument and computer to re-synchronise should anything go wrong: noise on the line masking the start bit for example. The period of time between the start and stop bit is constant, according to the baud rate and number of data and parity bits. The stop bit is always on. If the receiver detects an off value when the stop bit should be present, it knows there has been an error. The stop bit is not actually 1 bit but a minimum length of time the line must be on at the end of each data transmission. On PCs this is normally equal to 1 or 2 bits, and you must specify this in the driver software. Although 1 stop bit is most common, selecting 2 will at worst slow the message down slightly. (You might see an option to set the stop bit to 1.5. This is only used when the number of Data Bits is less than 7. If this is the case then ASCII characters cannot be transmitted and so 1.5 is rarely used.) * Flow Control (Handshaking) Unless you know differently, when connecting the instrument to the PC it is best to start with the assumption that flow control is not required. If you start with no flow control what symptoms might indicate that it really is needed?. One possibility is that the instrument misses part of a message sent by the computer. This will probably cause the instrument not to work properly. If flow control is required it will most commonly be Xon \ Xoff (software). ________________________________________________________ ________________________________________________________ Excel Corner: Closing All Open Worksheets ________________________________________________________ To close all worksheets at once, but leave Excel open: 1. Hold down the shift key on the keyboard and select Excel's File menu. 2. Choose the Close All option which has appeared. For more Excel tips and tricks, see https://www.windmill.co.uk/excel/ ________________________________________________________ ________________________________________________________ DAQ News Round-up ________________________________________________________ Welcome to our round-up of the data acquisition and control news. If you would like to receive more timely DAQ news updates then either grab our RSS newsfeed at https://www.windmillsoft.com/monitor.xml or follow us on Twitter at http://twitter.com/#!/DataAcquisition Robotic fish shoal sniffs out pollution in harbours Autonomous robotic fish designed to sense marine pollution, have taken to the open waves for the first time. Working in a group, the fish can cover a 1 km-square region of water, down to a depth of 30 metres. They communicate with each other and a nearby base-station using very low-frequency sound waves, which can penetrate the water more easily than radio waves. Source: New Scientist http://www.newscientist.com/ Meter enables cost-effective monitoring of energy usage A new device could help manufacturers monitor their energy usage more cost-effectively using technology originally created for washing machines. The new meter uses a 3D sensor, originally developed to monitor the position of washing-machine drums, that measures the magnetic field created by an electric current in the parallel direction as well as the perpendicular, making it more accurate than previous designs. Source: The Engineer https://www.theengineer.co.uk/ 90 Million Homes Worldwide Will Employ Home Automation Systems by 2017 New subscription-based home automation offerings are rapidly transforming the way consumers will monitor, secure, and control their homes. Source: ABI Research http://www.abiresearch.com/ Food, Water Safety Provide New Challenges for Today's Sensors Sensors that work flawlessly in laboratory settings may stumble when it comes to performing in real-world conditions, according to researchers. While sensors are becoming increasingly sophisticated, little or no field testing has been reported. Source: Newswise http://www.newswise.com/ New Point for Dew Point The Physical Measurement Laboratory has devised a new humidity generator that enables dew-point measurements up to 98 °C – a substantial extension above the previous limit of 85 °C – and provides expanded calibration services for hygrometers in a variety of industries. Source: NIST https://www.nist.gov/pml/div685/dewpoint.cfm ________________________________________________________ ________________________________________________________ * 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/
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.