Capture the weight from a scale with differentiated digits using our 232key software

This article describes how you can capture the weight from a weighing instrument with differentiated digits using 232key Plus.

What are differentiated digits (a.k.a. an “auxiliary indicating device”)?

When looking at the display of an approved class I or class II weighing instrument, you might notice that one or more digits are visually differentiated from the others:

Differentiated digits on A&D EK-610i approved class II weighing instrument

This is supposed to remind the user that on these instruments, the actual scale interval (d) is a multiple of the verification scale interval (e). For the scale shown above, e is 0.1 g and d is 0.01 g. Since e is used to determine the maximum permissible error, we can consider the differentiated digit(s) to be less accurate (but that’s not the topic of this article).

How to use 232key to capture differentiated digits

Some scales do not only visually differentiate the last digit(s), they also use a separator when transmitting them to a PC (or a printer). Instead of receiving a string like “250.01”, the software running on the PC would receive something like “250.0/1” or maybe “250.0[1]”.

As far as our virtual keyboard wedge software 232key is concerned, this additional separating character will prevent it from capturing the entire weight value. Instead, it would only capture “250.0” (highlighted in blue in 232key’s event log):

232key event log: differentiated digit not captured

Fortunately, you can easily fix this in the Plus version of our software in just two steps.

1. Modify the regular expression to ensure all required characters are captured

Let’s continue using “/” (slash) as a separator for this example. By default, most device profiles in 232key are meant to capture numbers and therefore 232key will stop capturing when it encounters the first non-numeric character. We have to change this behavior to make sure that 232key captures the digits preceding the separator, the separator itself and the following digit(s).

To do so, we first select the device profile we want to use (we’ll go with “Generic measurement instrument” in this example), and then click on the “Customize…” button to open the regular expression dialog:

232key: Regular expression dialog

The current regular expression captures the first number it encounters (which can be positive or negative and have a dot or comma as a decimal separator):

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

By expanding it as below we can instruct 232key to match a slash (“/”) and the following digits, too:

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

Depending on the selected device profile, the regular expression shown in the dialog might look different. What’s important is that it has to be expanded to include the separator and the differentiated digits.

2. Remove the separator

Thanks to the modified regular expression, 232key is now able to capture the entire value sent from the scale, including the separator. However, it would then either show a number format error (if we’ve selected a numeric device in the input tab) or type the data including the separator into the target application (if we’ve selected a text device). Both of these outcomes are not desirable.

Therefore, we also have to instruct 232key to remove the separator from the captured data by going to the “Process” tab and entering it in the “Remove” text field:

232key process tab: remove separator

Once this second step is completed, 232key handles differentiated digits correctly: When the scale sends “250.0/1”, 232key types “250.01” into the target application (e.g. a spreadsheet):

Weight typed into spreadsheet

Obviously, you might have to adapt these instructions to match the separator sent by your scale. As mentioned, you’ll also need a paid 232key Plus license to enable the functionality shown in this article. Please don’t hesitate to contact us should you need a trial license. For assistance, please email us or post in our support forum.

[related_posts_by_tax]

Ignore consecutive duplicates with 232key – parcel scale usage example

232key version 2016.2.3 comes with the ability to ignore consecutive duplicates. This means that you can instruct 232key to ignore identical data captured several times in a row. I’ll explain this new feature with two usage examples.

Usage example 1: Manually transferring the weight from a scale

Let’s say that you’ve set up 232key to capture the weight from a scale and type it into a parcel processing software running on a PC. To send the weight from the scale, the user presses the “Print” button on the scale’s indicator:
Print key Ohaus Defender 3000 parcel scale

Everything works fine, except that sometimes the button is inadvertently pressed twice, generating two parcel labels. You can use 232key’s new feature to prevent this from happening by checking the “ignore consecutive duplicates” option:
Ignore consecutive duplicatesThe new ignore function will prevent the second weight from being typed. However, sometimes you might actually encounter two parcels with the same weight in a row. The second parcel would now be ignored by 232key. To fix this, click on the “Adjust…” button and enter a time limit (in milliseconds, e.g. “3000” for 3 seconds):
Time limit

Any data received after the indicated time has passed is no longer ignored. Each new captured value resets the timer.

Usage example 2: Using auto print mode

In auto print mode, a scale sends the weight automatically without requiring the user to press a button. Not all scales are equipped with this mode and not all auto print modes work in the same way. The Ohaus T31P indicator used in our example has a very simple auto-print mode: It sends every stable weight to the connected PC. This can cause issues if the weight of an item fluctuates between two values: The scale might send these values several times for as long as the item remains on the platform (e.g. 20.00 and 20.05 [kg]).

This is where the second setting in the “ignore consecutive duplicates” dialog comes into play: By defining a tolerance, 232key ignores a range of values. For our example, we’d enter a tolerance of ±0.05:
Time limit and toleranceNow, when the scales sends a weight of 20.05 after just having sent 20.00, it is considered a duplicate and is not typed by 232key.

Notes:

  • The tolerance setting is only available if you’ve selected a numeric device in the “input” tab. It doesn’t make sense to apply a tolerance to text devices, e.g. barcodes received from a barcode reader.
  • If data is captured by 232key, it becomes the new reference for both the tolerance and timeout setting even if it is ignored (unless it’s empty, i.e. it contains no printable characters). For our second example with a tolerance setting of 0.05, this means that a value of 20.00 (received first) would be typed, but 20.05 (second) and also 20.10 (third) would be ignored (20.05 + 0.05 = 20.10).
  • We recommend that you set a timeout in addition to the tolerance setting to restrict the ignore function (but you don’t have to).
  • The new ignore function is not meant to be used with scales working in continuous mode (continuously transferring data several times per second).

[related_posts_by_tax]

232key version 1.6 preview

Our popular virtual keyboard wedge software 232key is about to receive a major update with significant user interface improvements as well as new functionality.

The first thing you’ll notice in the new version is that the tabs have been renamed and that a new tab has been added:

New Convert tab in 232key

Input: This used to be the “Interface” tab. It lets you specify from where 232key receives its input, i.e. from which device connected to which interface. Eventually, this tab will also include an option to capture data using custom regular expressions (planned for version 1.7) and further interface options (TCP/IP and possibly USB HID in addition to RS-232/COM port).

Convert: Here, you can tell 232key to convert the data captured from the connected device. A new operation allows you to remove (or keep) the first (or last) x characters, which can be useful if your device sends additional data which you do not want to keep. The multiplication, division and rounding operations which used to appear in the “Format” tab can also be found here. All of these operations are optional, therefore you can ignore the entire tab if no conversion is required.

Output: This tab contains all settings related to the simulated keyboard (and sound) output (e.g. keyboard type, additional keys to be sent before or after the data). These are the settings from the “Format” tab which were not moved to the “Convert” tab.

We hope that the reorganized tabs make working with 232key easier even as we keep adding new features. We’re now going to run extensive tests to ensure that our software works as reliably as ever. We look forward to releasing 232key version 1.60 in the coming week.