| |

Weighing Instrument Protocol Conversion: From RS232 ASCII to Modbus TCP with Programmable Gateway

1CH RS232485422 ETH V P2 0

Why Protocol Conversion Matters

Industrial weighing instruments are everywhere—floor scales in warehouses, axle weight meters at truck depots, analytical balances in pharmaceutical labs. According to industry data, the global industrial weighing equipment market was valued at $35–40 billion in 2024 , and the industrial gateway market reached $12–15 billion, growing at 8–10% annually . Yet many of these devices still communicate over RS232 using proprietary ASCII protocols that don’t speak to modern SCADA systems or cloud platforms.

The challenge isn’t the data itself. The challenge is that every manufacturer—and sometimes every model—uses a different format.

A Ningbo KeLi scale might output 02 20 20 20 20 20 20 33 35 30 20 20 20 33 35 30 0d to represent “350 kg”. A Shimadzu balance might send 20 20 20 2D 33 2E 35 31 36 20 20 47 53 0D 0A for “–3.516 g”. Both are valid RS232 data. Neither is something a Modbus TCP SCADA system can read directly.

This is where a programmable Modbus gateway becomes essential. It sits between the weighing instrument and the network, parsing the proprietary string, extracting the numeric value, and serving it over Modbus TCP.

The Problem: Non‑Standard Protocols

Weighing instruments vary widely in how they output data. Some use fixed‑length ASCII strings. Some include spaces, carriage returns, or line feeds. Some send positive and negative values with signs. Some use zero offsets (e.g., 50 mg as the zero point) to handle negative readings.

Here’s a sample of what actual instruments output:

InstrumentData Example (Hex)Meaning
Ningbo KeLi floor scale02 20 20 20 20 20 20 33 35 30 20 20 20 33 35 30 0d350 kg
Shimadzu analytical balance20 20 20 2D 33 2E 35 31 36 20 20 47 53 0D 0A–3.516 g
Shimadzu (positive)20 20 20 2B 32 2E 39 33 35 20 20 47 53 0D 0A+2.935 g

Without a gateway, integrating these into a unified system would require custom code for each device type—a project that can take weeks or months.

According to field data, 25–30% of serial communication failures stem from incorrect protocol conversion or register mapping . A programmable gateway eliminates that risk by handling the parsing and conversion in dedicated hardware.

Project Background

With the advancement of industrial IoT, data collection from equipment across various industries is increasingly vital. However, not all devices are easily compatible with cloud platforms. For example, weighing instruments with RS232 interfaces often use ASCILL code for weight measurement. The challenge lies in the timely and stable data push, which can be inconsistent across different manufacturers and weighing devices such as floor scales, axle weight meters, and analytical balances. These devices often have unique protocols, making it difficult to streamline data to the cloud.

1CH RS232485422 ETH V P2 1 1

Figure 1: Common Weighing Instruments

1CH RS232485422 ETH V P2 2

Figure 2: Common Weighing Instrument Models

Technical Specifications

Weighing instruments vary widely in design, as shown in the diagram below. Different manufacturers use unique protocols, even for similar models.

1CH RS232485422 ETH V P2 3

Figure 3: Serial Protocol Communication for Weighing Devices

Requirement Analysis

Weighing Instrument Data Collection Needs

For example, Ningbo KeLi weighing instruments use a Modbus gateway to simulate data pushes from a floor scale, with the data formatted in hexadecimal, like this: 02 20 20 20 20 20 20 33 35 30 20 20 20 33 35 30 0d. The actual weight data being transmitted is 350 350, in kilograms.

1CH RS232485422 ETH V P2 4

Figure 4: Ningbo KeLi Weighing Instrument Software

1CH RS232485422 ETH V P2 5

Figure 5: Ningbo KeLi Weighing Instrument

Weighing instruments for industries such as pharmaceuticals, textiles, and chemicals need to handle both positive and negative weights. For example, analytical balances use zero calibration values (e.g., 50mg as the zero point). The weighing data must account for both positive and negative values, depending on the industry.

Here are examples of common weighing devices and their protocols:

Weighing DeviceCharacter MessageHexadecimal MessageType
YaoHua / KeLi350 35002 20 20 20 20 20 20 33 35 30 20 20 20 33 35 30 0dPositive
Shimadzu-3.516 GS20 20 20 2D 33 2E 35 31 36 20 20 47 53 0D 0ANegative
Shimadzu+2.935 GS20 20 20 2B 32 2E 39 33 35 20 20 47 53 0D 0APositive

The Solution: A Programmable Modbus Gateway

A programmable Modbus gateway does three things:

  1. Reads the serial data from the weighing instrument (RS232, RS485, or RS422)
  2. Parses the string to extract the numeric value (handling signs, spaces, and unit codes)
  3. Serves the value over Modbus TCP, making it available to SCADA, PLCs, or cloud platforms

The 1CH-RS232/485/422-ETH (V) is a single‑port serial server with optical isolation. It can be configured to:

  • Accept incoming RS232 strings from the weighing instrument
  • Strip non‑numeric characters (spaces, CR, LF)
  • Convert the remaining ASCII digits to a 32‑bit integer or floating‑point value
  • Write the value to a Modbus holding register
  • Serve the register over TCP/IP on port 502 (standard Modbus TCP)

This turns a proprietary ASCII instrument into a standard Modbus TCP device—no custom code required.

1CH RS232485422 ETH V P2 6

Figure 6: Modbus Poll Data Reading

1CH RS232485422 ETH V P2 8

Figure 7: Serial Data Testing

The Valtoris programmable Modbus gateway configuration is straightforward. Simply ensure the IP address and communication computer are in the same local area network. Once configured, the gateway can convert and send the data in the appropriate Modbus format to a central system.

1CH RS232485422 ETH V P2 8 1

Figure 8: Modbus Gateway Configuration

1CH RS232485422 ETH V P2 9

Figure 9: Modbus Gateway Download Configuration Files

Real‑World Example: Converting a KeLi Floor Scale

A logistics company needed to pull weight data from 12 KeLi floor scales into a central SCADA system. Each scale output an ASCII string with spaces and a carriage return. The existing SCADA expected Modbus TCP.

Hardware: One programmable Modbus gateway per scale.

Configuration:

  • Serial: 9600, 8, N, 1
  • String parsing: strip all non‑numeric characters, convert to integer
  • Modbus register: 40001 (32‑bit integer)

Result: SCADA polls each gateway’s IP address on port 502 and reads the weight directly. No custom code, no protocol translators. The entire project took two days instead of the estimated two weeks.

Savings: According to industry data, programmable gateways can reduce integration time by 40–60% compared to custom software development .


Handling Positive and Negative Values

Not all weighing instruments output simple positive numbers. Analytical balances often use a zero offset to handle negative weights. For example, a balance might set 50 mg as the zero point—values below 50 mg are negative.

The gateway can be configured to:

  • Read the raw ASCII value
  • Apply a linear transformation: (value - offset) / scale
  • Output the result as a 32‑bit floating point value in Modbus registers

This makes it possible to handle tare weights, net weights, and negative readings without additional logic in the SCADA system.


Why Isolation Matters

Weighing instruments are often in electrically noisy environments—near motors, conveyors, or high‑voltage equipment. Ground loops can cause erratic readings or damage the gateway.

The 1CH-RS232/485/422-ETH (V) provides 1500V optical isolation on the serial side, preventing ground loops and protecting the network equipment. This is especially important in industrial settings where equipment is spread across different buildings or power sources.

According to industry data, isolated serial ports reduce field failure rates by 50–70% in electrically noisy environments .


What to Look for in a Programmable Gateway

FeatureWhy It Matters
Wide serial support (RS232, RS485, RS422)Covers all common weighing instrument interfaces
String parsingAbility to extract numeric values from ASCII strings with spaces, signs, and decimal points
Modbus TCP server modeDirect integration with SCADA and PLCs
Optical isolationProtects against ground loops and voltage spikes
Industrial temperature range (–40°C to 85°C)Works in outdoor or unheated environments
DIN rail mountInstalls cleanly in control panels
Web interfaceNo special software required for configuration