Polling And Logging Laboratory Instruments to CSV files
A complete guide to read data from RS232-compatible laboratory instruments and exporting parsed values directly into a CSV file with your value-column binding and log files rotation
1. Protocol Configuration: Laboratory Instruments
Communication Type: Passive Listening / Bidirectional (RS232 or USB Virtual COM)
Spectrophotometers, titrators, and blood analyzers often use proprietary ASCII formats or ASTM E1381/E1394 protocols. If the instrument outputs raw ASCII, use the 'ASCII Data Parser'. If it uses ASTM, you must use the dedicated 'ASTM Data Parser' plugin to correctly unpack the Header (H), Patient (P), Order (O), and Result (R) records.
Apply this base configuration for the serial connection:
{
"port": "COM4",
"baud_rate": 9600,
"data_bits": 8,
"stop_bits": 1,
"parity": "none",
"parser_type": "astm_e1381",
"ack_nak_handshake": true
}
Lab instruments data parser.

ASTM protocol parser settings.
Ready to connect Laboratory Instruments 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.

CSV export: file type selection and fine tuning.

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

Column configuration in CSV files.
3. Protocol-Specific Troubleshooting
- The instrument does not send data at all: Some instruments send data only when you press the "Print" button on it or require a special command from the host computer.
- The instrument sends one record and then stops transmitting: Many lab instruments require an ACK (Acknowledge) character after receiving a data block. Enable the 'ACK/NAK handshake' feature in the Data Logger so it replies and prompts the instrument to send the next batch.
- The program does not extract all data. Some fields are missed: By default, the logger extracts significant data only. You can create your parser using ASCII Data Parser plugin or ask our support team.
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.