Windmill Software Ltd
Windows Engineering Software

Mettler Toledo balance
June 2007

Interfacing a Mettler Toledo Balance

Home
Newsletters
Catalogue
Search

Windmill software lets you interface Mettler Toledo balances, and other instruments with an RS232 serial port, to a PC running Windows. Our new Windmill COMIML software is very easy to use and you can try before you buy. Alternatively, subscribers to the Monitor newsletter (ISSN 1472-0221) can download an earlier version of the driver (LabIML) for free.

This page helps you get started with the free Windmill 4.3 and LabIML software. (Configuration is similar with COMIML, but you use the comDebug program instead of the ConfIML program). There are three basic steps.

  1. Run the Windmill ConfIML program and enter your balance's communication settings.
  2. Run the Windmill SetupIML program and choose names 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 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.


Run the Windmill ConfIML program

This detects and saves a record of the hardware you want to use. You need to add the LabIML ASCII instrument handler and enter your instrument's communication settings. To do this

  1. Press the Add button.
     
  2. Select LabIML RS232 ASCII Instrument Handler.
     
  3. 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 the only value being measured.) Press OK.
     
  4. Enter your instrument's settings. These should work for Mettler Toledo balances:
    • Reading Protocol: Request/Response On Demand
    • Timeout: 5000
    • Instrument Idle Time: 0
    • 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.
       
  5. You now need to define how to extract data. To do this 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
    • 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" "
       
  6. 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.
     
  7. Save your settings and close ConfIML.

Now Run the Windmill SetupIML program

Here you can name your channel, set its units, any alarms and so on.

  1. From the Device menu select LabIML.
  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.

Now open Windmill DDE Panel

  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 by writing an Excel macro to read data from the Windmill DDE Panel. For more details see our Excel page.


Trouble-Shooting

If you are unable to get data from your balance then right click the LabIML icon on the task bar and select "Debug Options". You should see your command being sent to the balance, the balance's reply and Windmill extracting the data from the reply.

  1. If you only see your command being sent, and no data...
    1. Make sure that the balance is switched on and plugged into the PC's com (RS232) port.
    2. Check that the communication settings you entered in ConfIML match those currently in use by the balance: COM port, baud rate, parity, etc.
    3. If your balance says it is using 2400 baud, 7 data bits and even parity you may have it setup to talk to a printer rather than a computer. Use the balance's menu to change the Peripheral Unit from Printer to Host.
    4. Check that you have entered the correct command in ConfIML, in the correct case, with the carriage return and linefeed at the end. (Eg Prompt String of S\C013\C010)
    5. If you still have problems then get the balance to send an identification message. Switch it off and then on and it should send identification string I4, e.g. I4 A "0123456789". If not then turn off any handshaking and check your cable. At least three connecting lines are needed: Data line from the balance (TxD signal), Data line to the balance (RxD) and Signal ground line (SG). If possible try swapping the cable between the balance and the PC for another to see if that is the problem. (You may need a null modem cable.)
    6. If still no luck then download the comDebug program and see our Trouble-Shooting Serial Port Connections page.
  2. If, in LabIML's Debug Options, you see data coming in but the message "Parsing Failed" you need to change your parse string in ConfIML.

If you are getting accurate data readings, but much slower than expected, change your sampling rate. With LabIML, Windmill can make 5 readings per second per channel. So it can record one weight measurement every 0.2 seconds. If you have the sampling interval set much smaller than this, then Windmill may slow down considerably and only make a couple of readings per minute.


Success?

Have you successfully used Windmill with your balance? Let us know about your project.

Details of how you are using Windmill:

Name:          
Organisation:  
E-mail:        

Home | Windmill Programs | Monitor | On-Line Shop | Free Literature and Software Demos | Contents | Search

Copyright Windmill Software Ltd 2001
PO Box 58, North District Office, Manchester, M8 8QR, UK.
E-mail: sales@windmill.co.uk, Tel: +44 161 833 2782
http://www.windmill.co.uk/library.html
Data Acquisition News Feed (RSS) Free measurement news feed...
Designed by Studholme.net
Related Topics: