Reading Siwarex U Weight Data via TTY and RS-232 Protocol

David Krause18 min read
Serial CommunicationSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Reading Siwarex U Weight Data via TTY and RS-232 Protocol Without Siwatool

The Siemens Siwarex U weighing electronics module (7MH4950 family) supports a permanent, free-running TTY data stream on its front-panel 20 mA current-loop interface, and a request/response RS-232 command protocol on the same physical port. Both paths can be used to capture gross, net, and setpoint values without running Siwatool U on a connected PC. That is the configuration an unattended database logger, a SIMATIC S7-200 / ET 200 station, or any supervisory host needs in order to write weighing values into a SQL layer, an OPC tag, or a WinCC faceplate.

This reference covers the TTY continuous-output mode as the primary path (Siemens documents the Siwarex M and Siwarex U protocols as the same family), the RS-232 request/response mode as the secondary path, the hardware wiring with a TTY↔RS-232 converter, the one-time DIP-switch configuration of the module, the data-record fields that the receiver must parse, and the commissioning checks required before any value is written to a production database.

Why TTY is the practical default for read-only logging: the TTY interface transmits unsolicited, continuous frames as soon as the Siwarex U is in run state. The host only has to read serial bytes, parse a fixed-length record, and write to a database. The RS-232 path requires the host to construct and send a request frame, then wait for a slave response, which adds turnaround, timeout, and collision handling for no benefit when the application only needs to log the current weight.

Siwarex U Hardware Identification and Interface Options

The Siwarex U is a single-channel weighing electronics module designed to integrate into a SIMATIC S7-200 system or an ET 200 distributed I/O station. The two serial interface options on the front panel are summarised in the table below.

Interface Electrical layer Protocol Direction Use case
TTY (front-panel 9-pin sub-D) 20 mA current loop, isolated Continuous ASCII frame, unsolicited Siwarex → host Read-only logging
RS-232 (front-panel 9-pin sub-D, second connector on some variants) ±12 V EIA-232 Request/response command set, same family as Siwarex M Bidirectional Read + remote tare / zero / cal

The TTY port is not a logic-level UART and cannot be wired directly to a PC COM port, an S7 CPU PtP interface, or an RS-485 transceiver. A passive or active TTY↔RS-232 converter is mandatory. The RS-232 port (where the variant exposes one) connects directly to a PC COM port or to a CPU module that exposes a true EIA-232 channel.

Pinout of the Siwarex U TTY connector

Pin Signal Direction Description
1 TTY_TX+ Output 20 mA current loop transmitter, +
2 TTY_TX− Output 20 mA current loop transmitter, −
3 — — Reserved / shield
4 — — Reserved
5 GND — Ground reference for shield
6 +24 V Output Auxiliary supply for an active converter
7 — — Reserved
8 — — Reserved
9 — — Reserved
Verify against the printed manual: pin assignments are documented in the Siwarex U device manual bundled with the unit; the wiring diagram in that manual is the authoritative source. Earlier hardware revisions placed the TTY loop on different pins, and the Siwarex M front-panel pinout is not a drop-in replacement.

TTY vs RS-232: Choosing the Right Path

Criterion TTY continuous output RS-232 request/response
Host complexity Read serial bytes only Send request, parse response, handle timeouts
Data latency ≈ 1 update period (typically 200 ms at 5 measurements/s) Round-trip + processing time
Converter required Yes — TTY↔RS-232 No
Multi-drop No — point-to-point only No — point-to-point only
Configuration effort One-time DIP switch + Siwatool command Full command-set mapping plus one-time config
Bidirectional commands (tare, zero, cal) Not supported Supported
Best for Database logging, trending, HMI display SCADA control loops, recipe download, remote calibration

For a read-only database logger, the TTY path is the correct choice: it is unsolicited, the host does not have to drive the line, and the frame contains exactly the four process values the application needs (Gross value channel 1, Specified value 1, Gross value channel 2, Specified value 2). The RS-232 path is justified only when the host also needs to write setpoints, trigger remote tare, or change calibration parameters from the same application.

TTY Protocol Specification

Electrical and link layer

  • 20 mA passive or active current loop, full-duplex capable but used simplex (Siwarex → host) in continuous-output mode
  • Baud rate: 1200, 2400, 4800, 9600, 19200 — selected by DIP switch on the Siwarex U faceplate
  • Frame: 8 data bits, no parity, 1 stop bit (8N1) — verify against the manual for the firmware revision in use
  • Flow control: none
  • Update period: typically 200 ms (5 measurements/s); check the configured measurement rate in Siwatool

Data record fields

In continuous-output mode, the Siwarex U transmits a record that contains the four process values listed in the source conversation — Gross value channel 1, Specified value 1, Gross value channel 2, Specified value 2 — plus status, unit, and termination fields. The record is a fixed-length ASCII block; the exact field order, separator characters, and check bytes are documented in the Siwarex U device manual (page 11-5 of the bundle referenced in the field report) and in the Siwarex M reference manual, which Siemens states uses the same protocol family.

Field Meaning Typical width
Status / command byte Operating state, fault, calibration flags 1–2 bytes
Gross value channel 1 Channel 1 gross weight 7 digits, sign, decimal point
Specified value 1 Channel 1 net weight after tare (the "specified" or net value) 7 digits, sign, decimal point
Gross value channel 2 Channel 2 gross weight (differential scale or second scale) 7 digits, sign, decimal point
Specified value 2 Channel 2 net weight 7 digits, sign, decimal point
Unit kg, g, t, lb 2 characters
Terminator CR / LF or checksum byte 1–2 bytes
Frame details: the exact byte map, field separators, and the on/off sequence required to enable continuous mode are documented in the Siwarex U device manual that ships with the hardware revision in use. Siemens has revised the framing across firmware versions; do not hard-code a parser from a forum example without checking the bytes against the manual.

RS-232 Protocol Specification (Siwarex M / U Family)

The RS-232 path is a request/response protocol at the same baud-rate options as the TTY port. A typical read sequence is:

  1. Host sends a request frame addressed to the Siwarex (default address 1, configurable in Siwatool).
  2. Siwarex returns a response frame within ≤ 200 ms containing the requested process value.
  3. Host extracts the value, applies any required unit conversion, and writes it to the database.

The full command/response table is documented as identical for the Siwarex M and Siwarex U modules, which is why the Siwarex M manual is a valid reference for the Siwarex U serial interface. The commands the host typically issues are listed below; the exact mnemonics, register codes, and CRC bytes are in the manual.

Command (typical) Function Typical response
RD_GROSS1 Read gross value channel 1 ASCII 7-digit value + sign + unit
RD_NET1 Read net (specified) value channel 1 ASCII 7-digit value + sign + unit
RD_GROSS2 Read gross value channel 2 ASCII 7-digit value + sign + unit
RD_NET2 Read net (specified) value channel 2 ASCII 7-digit value + sign + unit
WR_ZERO Remote zero / tare ACK / NACK
WR_CAL Trigger calibration sequence ACK / NACK + status

For an unattended database logger the read-only commands (RD_*) are the relevant subset; the write commands should be protected by an authorisation layer in the host so that a single rogue frame cannot zero the scale.

Hardware Wiring and Converter Selection

The Siwarex U TTY port must be connected to a 20 mA current-loop to RS-232 converter. Two converter classes are accepted in the field.

  • Passive converter — derives loop current from the RS-232 handshake lines (RTS/CTS). Cable length limit ≈ 5 m. Suitable for bench testing only.
  • Active converter — has its own 24 V supply, often DIN-rail mount. Cable length up to 100 m. Required for industrial installation.
Converter Type Notes
Siemens 6ES7 090-0AA00 Active TTY↔RS-232 Documented for Siwarex M, applies to U
W&T 83000 / 83010 series Active TTY↔RS-232 Third-party, DIN-rail mount, galvanic isolation
B+B SmartWorx Active TTY↔RS-232 Galvanic isolation preferred for runs above 30 m

Wiring rules

  1. Use twisted pair for the loop wires; tie the shield to ground at one end only (converter end is preferred).
  2. Respect polarity: TTY_TX+ on the Siwarex must land on the matching + terminal of the converter. Reversed polarity produces a permanently empty receive buffer with no error indication.
  3. Keep the loop cable at least 200 mm away from VFD output cables, contactor coils, and any unfiltered switching supply — the 20 mA loop is sensitive to common-mode injection.
  4. If the host is an S7 CPU with a true RS-232 PtP interface (e.g., CP 340, CP 341, ET 200S 6ES7 138-4DF01-0AB0), wire the converter output to the CPU port — never wire the Siwarex TTY loop directly to a CPU PtP module.
  5. For cable runs above 30 m, fit a ferrite on each loop wire at the converter end to suppress the 9.6 kHz fundamental and its harmonics.

Topology diagram

Siwarex U 7MH4950 Load cell input DIP-switched 20 mA loop (2 wires) TTY↔RS-232 Active converter +24 V supply Galvanic isolation RS-232 (DB9, 9.6 kHz) Host PC COM / S7 PtP DB writer / HMI 5 frames/s Siwarex U → TTY loop → TTY↔RS-232 converter → host serial port

Siwarex U Configuration for Continuous TTY Output

The Siwarex U requires a one-time configuration to switch its serial port from the default Siwatool mode into the continuous TTY output mode. The configuration is held in non-volatile memory on the module and survives power cycling.

  1. Set the front-panel DIP switches for the desired baud rate (9600 is the most common) and for the continuous-output protocol. The DIP switch legend is printed on the module faceplate; the exact switch numbers are listed in the device manual.
  2. Connect a PC running Siwatool U to the Siwarex once and send the command sequence that enables the continuous-output protocol. Siwatool U is only required for this one-time configuration step; once the module is in continuous-output mode, Siwatool can be disconnected.
  3. Cycle power to the module to confirm the configuration has been written to non-volatile memory.
  4. Connect the TTY↔RS-232 converter and the host. No further configuration is required on the Siwarex for read-only logging.
Loss of Siwatool host access: once the Siwarex is switched into continuous-output mode, a Siwatool session can no longer attach to the same port. If subsequent reconfiguration is required, the module must be returned to Siwatool mode by re-issuing the configuration command sequence, which means the host must either share the port with Siwatool or the Siwarex must be temporarily disconnected from the logger during reconfiguration. Plan a maintenance window into the project schedule.

Data Stream Parsing on a PC Host

Python implementation

A typical implementation in Python on a PC with a real or USB-serial COM port:

import serial
import time
import mysql.connector

ser = serial.Serial(
    port='COM3',
    baudrate=9600,
    bytesize=serial.EIGHTBITS,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    timeout=1.0,
)

db   = mysql.connector.connect(host='10.0.0.50', user='logger', password='****', database='plant')
cur  = db.cursor()

# Frame layout (verify separator and field order against the manual
# bundled with the Siwarex U revision in use):
#   STX, status, gross1, net1, gross2, net2, unit, ETX, CR, LF
while True:
    raw = ser.readline()
    if not raw:
        continue
    line = raw.decode('ascii', errors='ignore').strip()
    if len(line) < 20:           # reject partial frames
        continue
    fields = line.split(';')      # substitute the real separator from the manual
    if len(fields) < 6:
        continue
    try:
        status = fields[0]
        gross1 = float(fields[1])
        net1   = float(fields[2])
        gross2 = float(fields[3])
        net2   = float(fields[4])
        unit   = fields[5]
    except ValueError:
        continue                   # reject malformed lines silently
    cur.execute(
        "INSERT INTO weights (ts, status, gross1, net1, gross2, net2, unit) "
        "VALUES (%s, %s, %s, %s, %s, %s, %s)",
        (time.time(), status, gross1, net1, gross2, net2, unit)
    )
    db.commit()

C# (.NET) implementation

using System.IO.Ports;
using System.Data.SqlClient;

var port = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One) { NewLine = "\r\n" };
port.Open();

using var sql = new SqlConnection("Server=PLANTSQL;Database=plant;Integrated Security=SSPI;");
sql.Open();

while (true) {
    var line = port.ReadLine().Trim();   // blocks until CR/LF
    if (line.Length < 20) continue;
    var f = line.Split(';');             // substitute the real separator
    if (f.Length < 6) continue;
    using var cmd = new SqlCommand(
        "INSERT INTO weights (ts, status, gross1, net1, gross2, net2, unit) " +
        "VALUES (SYSUTCDATETIME(), @s, @g1, @n1, @g2, @n2, @u)", sql);
    cmd.Parameters.AddWithValue("@s",  f[0]);
    cmd.Parameters.AddWithValue("@g1", double.Parse(f[1], System.Globalization.CultureInfo.InvariantCulture));
    cmd.Parameters.AddWithValue("@n1", double.Parse(f[2], System.Globalization.CultureInfo.InvariantCulture));
    cmd.Parameters.AddWithValue("@g2", double.Parse(f[3], System.Globalization.CultureInfo.InvariantCulture));
    cmd.Parameters.AddWithValue("@n2", double.Parse(f[4], System.Globalization.CultureInfo.InvariantCulture));
    cmd.Parameters.AddWithValue("@u",  f[5]);
    cmd.ExecuteNonQuery();
}

Watchdog and stale-frame detection

Wrap the read loop in a watchdog that triggers an alarm if no valid frame has been received within 3 × the Siwarex update period. With the default 200 ms period, the alarm trips at 600 ms of silence. This is the only way to detect a broken loop wire, an unplugged converter, or a Siwarex in a fault state — the serial port will simply time out on readline() and return an empty string.

Integration with SIMATIC S7-200, S7-300/400 and TIA Portal

S7-200 path

The S7-200 CPU 22x base unit has no native RS-232 PtP port. The TTY stream from the Siwarex U can be brought into the S7-200 in two ways.

  1. Via a third-party RS-232-to-S7-200-backplane bridge — the bridge parses the TTY frame in firmware and exposes the four values as V-memory words that the user program can read with normal load instructions.
  2. Via an ET 200S station with an RS-232 PtP module (e.g., 6ES7 138-4DF01-0AB0) — the ET 200S master interface is the S7 CPU, and the Siwarex U sits in the same station as a distributed load-cell module.

The S7-200 side of the parser can be written in STL; the snippet below reads one floating-point value from VB100 onward and copies it to VD200.

// S7-200 STL fragment — copy parsed real from VB100 to VD200
LD    SM0.0
BTI   VB100, VW200        // optional: scale integer to engineering units
MOVR  VD200, VD300        // place in a DB the HMI can poll

S7-300/400 path

For S7-300/400 systems, the Siwarex M is the more natural choice. The Siwarex U can still be read via an ET 200S PtP module (1SI 6ES7 138-4DF01-0AB0) configured in ASCII mode. The Freeport / ASCII driver in the 1SI accepts a fixed-format record terminated by CR/LF and exposes it as a block of bytes in the input buffer; a user-written FB in SCL or STL splits the buffer and writes the four real values into a process image DB.

TIA Portal HMI path

WinCC in TIA Portal supports a generic serial driver that parses a fixed-format ASCII record into numeric tags. Configure the channel as follows.

  • Port: COMx, 9600, 8N1
  • Trigger: on each terminator (CR/LF)
  • Parse: split on the field separator defined in the Siwarex frame, map fields 2..5 to four real-type tags, map field 6 to a text tag for the unit
  • Update rate: equal to the Siwarex update period (200 ms is typical)
  • Acquisition mode: cyclic, with a configurable timeout that drives a "Stale data" alarm tag

Verification and Commissioning Checks

Before any value is written to the production database, the following checks must pass. The sequence is ordered from physical layer upward so that an early failure does not waste time on the higher-layer tests.

  1. Loop current verification — measure 20 mA flowing in the loop with a clamp meter or by breaking the loop and inserting an ammeter. Reverse-polarity conditions show as 0 mA; an open converter shows 0 mA; a shorted loop shows > 25 mA.
  2. Frame integrity — capture 100 consecutive frames in a serial-port monitor (e.g., HHD Software Free Serial Port Monitor, Docklight) and confirm zero parity, framing, or checksum errors. The Siwarex U should produce one frame every update period (typically 200 ms → 5 frames/s).
  3. Static load test — apply a known calibration weight, confirm the read value matches within the declared accuracy class (typically 0.05 % for Siwarex U).
  4. Status field — verify the status field reports RUN or OK; any non-zero status must be alarmed, not silently overwritten.
  5. Database round-trip — write a value, read it back, confirm the timestamp and the floating-point value match to the last decimal; check for locale-related decimal-comma vs decimal-point issues on non-English Windows hosts.
  6. Soak test — let the logger run for 24 h and confirm zero frame loss, zero checksum errors, and zero unexplained zero-shift events.

Troubleshooting Matrix and Field-Proven Caveats

Symptom Probable root cause Corrective action
No bytes received on host TTY loop polarity reversed; converter unpowered; DIP switches at factory default (Siwatool mode) Re-check polarity with a multimeter, apply 24 V to active converter, set DIP switches to continuous TTY mode and power-cycle
Bytes received but all are 0x00 or 0xFF Baud-rate mismatch Verify host baud rate matches the Siwarex DIP switch; try 1200, 2400, 4800, 9600, 19200 in turn
Frames received, values stuck at the calibration zero Module is still in Siwatool mode and is responding only to host requests; host is not sending requests Switch the module into continuous TTY mode via one-time Siwatool configuration, then power-cycle
Values jitter ±2 LSB at rest Mechanical vibration on the scale; Siwarex low-pass filter not enabled Enable the digital low-pass filter in Siwatool, or apply a moving average in the host
Periodic checksum / framing errors Electrical noise; ground loop; unshielded cable run Use shielded twisted pair, ground shield at one end, fit a galvanically isolated converter
Status field reports a non-zero fault code Load-cell excitation failure, sense-line break, or out-of-range weight Check load-cell wiring, sense-line jumpers, and the load-cell resistance (typically 350 Ω for a 4-wire cell)
Values drift over hours Temperature drift in the load cell; mechanical creep in the support structure Re-zero via the WR_ZERO command, log the zero-shift, consider periodic auto-re-zero
Logger runs fine for hours, then stops for several minutes Windows USB-serial driver suspend; USB hub power management Disable USB selective suspend, use a powered hub, or switch to a native COM port
Values display as decimal-comma on a German Windows host System locale parsing rule in float() Force CultureInfo.InvariantCulture on every float.Parse call
Siwatool cannot attach after TTY mode is enabled Normal — the port is now in continuous-output mode Re-issue the configuration command sequence from a maintenance laptop, then resume logging

Field-proven caveats

  • The Siwarex U TTY output is a unidirectional stream. A host that needs to write back to the module (tare, zero, calibration) cannot use the TTY port in continuous mode; it must use the RS-232 port and the request/response command set, which requires the same port on the Siwarex to be reconfigured via Siwatool — a maintenance event, not a runtime event.
  • The 20 mA current loop draws its power from the Siwarex U front panel. On long cable runs, voltage drop in thin loop wires can starve the converter; use ≥ 0.5 mm² loop conductors and verify the loop voltage at the converter input is within the converter's specified range.
  • The Siwarex U update period is configurable in Siwatool. A 50 ms update period produces 20 frames/s and a heavy CPU load on a Python logger. For database logging, 200 ms (5 frames/s) is the practical default.
  • Multiple Siwarex U modules cannot share a single TTY loop. For a multi-scale system, use a Siwarex M with the RS-232 multi-drop protocol, or one TTY loop per Siwarex U.

Safety, EMC and Maintenance

  • The Siwarex U is a measurement module and must not be used as the sole load sensor for personnel-protection functions (e.g., crane overload cut-off, elevator brake release, SIL-rated dosing). For safety-rated weighing, use a module and a load-cell combination that carries an explicit SIL or PL rating, and wire the safety function through a certified safety relay.
  • The 20 mA loop is a SELV interface. Maintain SELV separation between the loop wiring and any mains-voltage cables run in the same duct; if they must cross, cross at 90°.
  • EMC: the loop acts as a small antenna at the baud-rate fundamental. For cable runs above 30 m, fit a ferrite on each loop wire at the converter end; the ferrite impedance at 9.6 kHz is sufficient to suppress the common-mode current that produces framing errors.
  • Annual maintenance: re-zero the scale with a known dead-weight, capture a 24 h soak log, verify the watchdog alarm fires within 1 s of a deliberately disconnected loop.
  • Spare-parts strategy: keep at least one spare TTY↔RS-232 converter in the panel store, labelled with the Siwarex U variant and baud rate it is configured for. A converter failure is the single most common field failure on these installations.

FAQ

Can the Siwarex U send weight data to a PC without Siwatool running?

Yes. Set the module's DIP switches to continuous TTY output mode, perform the one-time configuration of the protocol via Siwatool, then connect a TTY↔RS-232 converter to a PC COM port. The module will then transmit gross, net, and channel-2 values continuously without any host request, and the host only has to read the serial bytes and parse the frame.

Which protocol is simpler, TTY continuous output or RS-232 request/response?

The TTY continuous-output mode is simpler because the host only has to read and parse a fixed-length record. The RS-232 path is a request/response protocol that requires the host to construct a command frame, send it, and parse the reply, which adds turnaround and timeout handling. For read-only database logging, TTY is the right choice.

What baud rate should be selected for Siwarex U TTY output?

9600 baud, 8 data bits, no parity, 1 stop bit is the most common configuration and is supported by all current Siwarex U firmware revisions. Lower rates (1200, 2400, 4800) are also supported for long cable runs; 19200 is supported on later hardware revisions. The DIP switch on the Siwarex faceplate selects the baud rate.

Is the Siwarex M serial protocol identical to the Siwarex U protocol?

The RS-232 request/response command set is documented by Siemens to be the same family across the Siwarex M and Siwarex U modules, which is why the Siwarex M manual is referenced for the Siwarex U serial implementation. The exact byte framing must still be verified against the Siwarex U manual bundled with the hardware in use, because Siemens has revised the framing across firmware revisions.

Can the Siwarex U TTY output be wired directly to an S7-200 CPU port?

No. The S7-200 base unit does not have a true RS-232 port, and the TTY 20 mA current loop must be converted to RS-232 before it can be presented to any S7 CPU PtP interface or to a PC. A dedicated TTY↔RS-232 converter (active type for industrial use) is mandatory.

Back to blog