How to capture only the end result from a Mettler Toledo H53 Moisture Analyzer with 232key

Real-life example: Moisture Analyzer

One of customers wanted to capture the end result from his Mettler Toledo H53 moisture analyzer using our 232key software. However, the moisture analyzer sent a lot of data at the end of the moisture determination process:

14:08:42 Port opened: COM3 Bitrate: 9600 Data bits: 8 Stop bits: 1 Parity: NONE
...
14:08:45 -MOISTURE DETERMINATION-<13><10>
14:08:45 METTLER TOLEDO<13><10>
14:08:45 Type             HE53/01<13><10>
14:08:45 SNR           B123456789<13><10>
14:08:45 SW                  1.13<13><10>
14:08:45 <13><10>
14:08:45 Drying Prog.       Rapid<13><10>
14:08:45 Drying Temp.      130 <29>C<13><10>
14:08:45 Switch-Off          Auto<13><10>
14:08:45 Display mode         %AM<13><10>
14:08:45 <13><10>
14:08:45 Start Weight   0.637 g  <13><10>
14:08:45 <13><10>
14:08:45 Total Time      4:20 min<13><10>
14:08:45 Dry Weight     0.604 g  <13><10>
14:08:45 End Result      5.46 %AM<13><10>
14:08:45 <13><10>
14:08:45 Date: ..............<13><10>
14:08:45 Time: ..............<13><10>
14:08:45 <13><10>
14:08:45 Comment: ...............<13><10>
14:08:45 Signature: .............<13><10>
14:08:45 – ----- – END – --------<13><10>
14:08:45 <13><10>
14:08:45 <13><10>
14:08:45 <13><10>

Our customer was only interested in the end result (5.46 in the example above), but 232key captured and typed all the numbers it could find, resulting in the following output:

531234567891.131300.63740.6045.46

Regular Expressions to the rescue

Our software includes a powerful tool for such cases: regular expressions. Don’t worry, you don’t have to learn about them in detail. You can simply send us the data received from your device as displayed in the Event Log of our software (as shown above) and we’ll assist you. However, in some cases, all it takes is a small modification.

If you go to the Input tab in 232key and click on the Customize button, the currently used regular expression will be displayed:

Regular Expression in 232key MU

For the “Generic measuring device” and many other device profile, it looks as follows:

([-+]?\s*[0-9]*[\.,]?[0-9]+)

This regular expression captures the first number it encounters in each line of data. If you want to capture only the data of a specific line and ignore all others, look at what makes it unique. In this case, we could use the words “End Result”. Simply inserting them at the beginning, followed by “\s+” (which stands for “one ore more whitespace characters”) ensures that 232key only captures the number following these words:

End Result\s+([-+]?\s*[0-9]*[\.,]?[0-9]+)

That’s all it takes in this case. Alternatively, we could use the “%” character appearing at the end of the “End Result” line. As there’s no other line in the report where a number is followed by a percentage sign, the following regular expression also works (and will continue to work even if the user changes the language of the report):

([-+]?\s*[0-9]*[\.,]?[0-9]+)\s+%

Regular expressions are available in 232key Plus, 232key MU, 232key Pro and our Simple Data Logger software.

232key version 2020.1 released – Radwag and Mars Scale profiles

Version 2020.1 of our free virtual keyboard wedge software 232key is now available!

Improvements in 232key version 2020.1

  • New device profiles for Radwag scales and balances and Mars Scales.
  • UI and accessibility improvements (you can switch between tabs and trigger the start/stop button using an Alt + key combination).
  • We fixed a bug which prevented the import* of a previously exported configuration file. This problem only appeared when more than one license had been applied to the software and when the second or a later license had expired.
  • We’ve included many new keys which 232key can now press before* or after the measurement value:
    232key additional keys to press before measurement value

Download the 232key installer now or visit 232key.com for further information.

* This functionality requires a paid 232key Plus license.

Are you a manufacturer and would like us to include a profile for your devices?

Please contact us and provide us with the following pieces of information:

  • Default connection parameters: bit/s, data bits, stop bits, parity.
  • Terminator (last character in each line of data).
  • An example of the data transmitted (in ASCII and hexadecimal form).
  • Optional: The command used to trigger the device to send the data (this is supported by 232key Pro and Simple Data Logger).
  • Optional: Short instructions to be displayed to the user (e.g. “set communication mode to ‘PC'”).
  • Is this information valid for all your devices?

Note: We’ll try our best, but we cannot guarantee that all submissions will be included.

232key version 2019.1 released – SMA Scale Communication Protocol

Version 2019.1 of our virtual keyboard wedge software 232key is now available.

* This device profile requires a Plus license. Please contact us for trial licenses.

  • Bug fixed: Function keys set under “start with” were not working correctly.

Are you interested in reselling our software? Click here for further information and to apply for a reseller account.

232key version 2018.1.4 released – includes flow control support and new profiles for Mettler Toledo and Sartorius balances

Version 2018.1.4 of our virtual keyboard wedge software for devices with RS-232 interface is now available and includes the following new features:

  • Flow control (handshaking) functionality (XON/XOFF software flow control and RTS/CTS hardware flow control):
    Flow control (handshaking): RTS/CTS and XON/XOFF
  • Device profiles: Mettler Toledo (MT-SICS), Sartorius (SBI), Sartorius (SICS), Denver Instrument.
  • Previous “Sartorius” device profile renamed to “Sartorius (legacy)” and modified to set flow control to “RTS/CTS” automatically. This profile works with older Sartorius balances which require hardware flow control.

These improvements were possible thanks to the feedback from our customers.