bg

Polling And Logging Weight Scale Device to CSV files

A complete guide to read data from weight scales and balances and exporting parsed values directly into a CSV file with your value-column binding and log files rotation

1. Protocol Configuration: RS232 Weight Scale

Communication Type: Passive Listening (Continuous or Print-on-Demand)

Most industrial scales send ASCII strings terminated by a Carriage Return (CR) and Line Feed (LF). Use the software's 'ASCII Data Parser' module and set the data packet signature to ending characters '#0D#0A'. You can then extract the numeric weight by specifying fixed column positions or using a regular expression. Furthermore, the logger contains pre-defined parsers for the most popular scales.

Apply this base configuration for the serial connection:

{
  "port": "COM1",
  "baud_rate": 9600,
  "data_bits": 8,
  "stop_bits": 1,
  "parity": "none",
  "flow_control": "hardware",
  "packet_end": "#0D#0A"
}
Weight scales and balanced plugin selection to poll a device and parse incoming data.

Weight scales and balanced plugin selection to poll a device and parse incoming data.

Weight scales and balanced plugin configuration: weight scale type and polling interval.

Weight scales and balanced plugin configuration: weight scale type and polling interval.

Ready to connect RS232 Weight Scale to CSV File?

2. Database Setup: CSV File

Use the built-in 'Local database' export module. No external drivers are necessary.

Use the following SQL script to create your target table. Do not log continuously into a single CSV file for years. Use the software's 'Log File Rotation' setting to automatically start a new file daily (e.g., `Log_YYYYMMDD.csv`). This prevents files from becoming too large to open in Excel.

No SQL required. You can define a custom header row in the plugin settings to match the exported variables.
Plugin selection to export parsed data to CSV or text files.

Plugin selection to export parsed data to CSV or text files.

CSV export: file type selection and fine tuning.

CSV export: file type selection and fine tuning.

CSV data formatting rules (date, numbers, etc.).

CSV data formatting rules (date, numbers, etc.).

Column configuration in CSV files.

Column configuration in CSV files.

3. Protocol-Specific Troubleshooting

  • Garbage characters appearing on the screen: This almost always indicates a baud rate or parity mismatch. 9600-8-N-1 is standard, but older Mettler Toledo or Ohaus scales frequently use 2400 baud or 7-Even-1 parity. Check the hardware manual.
  • Is it possible to process stable weight only and ignore intermediate values?: Use one of our filter plugins, and for example, ignore all records without the "stable" signature in a data packet.
  • Is it possible to process weight values greater that 100.0 kg?: The Expressions filter plugin allows you to using any math expression For example, the following command: DISCARD_DATA_PACKET_IF(WEIGHT < 100).

4. Database-Specific Troubleshooting

  • Excel opens the file but all data is squeezed into one column: This is a regional settings issue. In North America, the list separator is a comma (,), but in Europe, it is often a semicolon (;). Ensure the delimiter set in the Data Logger matches the regional settings of the PC opening the file.
  • How to get my serial.print to be written into a CSV file: This is the simplest case. The logger does not need to process something in your case. Just enable logging to a file before parsing and change the log file extension to 'csv'.
  • Can I write CSV data to a network share to use it from my computer?: Yes, you can specify the destination path as '\\server_name\folder\filename.csv'. If your incoming data is fast, it is better to create a new log file frequently, for example, every hour.

Ready to connect RS232 Weight Scale to CSV File?

Product Buy Download Support Contacts Site map
Copyright © 1999 - 2026, AGG Software.
All rights reserved.. Terms of use | Privacy policy