bg

Extract and Modify Lab Instrument Data for Excel Export



Problem scenario

We push a button on a YSI MultiLab instrument to transfer measurements to a cell in Excel running on a PC. The connection driver is a USB to UART bridge. The data string sent by the YSI MultiLab is many lines and characters long, containing additional information that is not needed.

02.11.2025 07:34:52
4099-3
Ser. No.  1343XXXX
ProOBOD
Ser. No.  21E10XXXX
ProOBOD Cap  23G100129
Ox   8.18mg/L 19.3 C AR, S:  +++
YSI 4310
Ser. No.  24636XXXX
Cond 0.0 S/cm 18.5 C, AR
C = 0.475 1/cm, Tref25, nLF
YSI 4320
Ser. No.  2636XXXX
Cond 0.01 S/cm 17.8 C, AR
C = 0.100 1/cm, Tref25, nLF

Using software, we should filter out all unwanted data by extracting the line of data left of the substring "C AR". Then we need to extract two numerical values from that row. After this, the program should combine a new string like "VALUE1, VALUE2<carriage return>" that is entered into the Excel cell:

8.17, 19.3

Requirements

  • Advanced OPC Data Logger Professional, Enterprise, or a trial version;
  • ASCII Data Parser and Query plugin for Data Logger - to extract data packets and the necessary values (it exists in the standard installation package).
  • Expressions plugin - for data modification and preparing for exporting (the plugin exists in the standard installation package).

Tip: If the communication parameters or command format for your instrument are not known, but you have a manufacturer's software, you can use it together with our Advanced Serial Port Monitor utility running in the "Spy" mode, to watch and inspect a data exchange protocol between the device and the computer.

Solution

We're skipping the step of adding a new configuration and setting up communication parameters. You can look at another tutorial.

1. Ensure that you receive data from your length meter device in the main window (fig. 1). It means that you've configured communication parameters and an optional request correctly, and you may continue configuring a parser plugin.

Incoming serial data
Fig. 1. Incoming serial data.

2. Now, we need to figure out where data packets begin and end. The program will use them to separate data blocks from a data flow. In this data example, a data packet starts with "Ser. No." and ends with "C AR". Look at our other data parsing examples.

3. Go to the parser setting to get desired values from a data packet. Select the "ASCII data parser and query" plugin from the "Parser module" list (fig. 2), select the "Parsing and exporting for data received" option, and click the "Setup" button.

Enabling the parser
Fig. 2. Enabling the parser.

4. Specify data packet signatures from step #1 on the first tab in the parser settings.

Data packet parser settings
Fig. 3. Data packet parser settings.

5. The next step is adding parser variables, which we will use to create a new data string later:

  1. Regular expression pattern for the first value: ([\d\.]+)mg\/L. It extracts a number right before the "mg/L" signature.
  2. Regular expression pattern for the second value: mg\/L\s+([\d\.]+). It takes out a number after the "mg/L" signature and a few spaces.

We can leave the "string" data types of extracted values because we'll export this data "as-is".

Parser variables
Fig. 4. Parser variables.

6. Post-processing. The following expressions combine the new "RESULT" variable that you can use in any data export plugin. This tutorial demonstrates how to associate this variable with a cell in the spreadsheet.

Selecting the filter plugin for postprocessing
Fig. 5. Selecting the filter plugin for post-processing.

Adding post-processing formulas
Fig. 6. Adding post-processing formulas.

7. On this stage, you should configure the "Direct Excel Connection" plugin. It can export data in real-time to the opened Excel document, to the specified cell.

Go to the "Modules → Data export" tab and place a mark before this plugin.

Enabling the Direct Excel Connection plugin
Fig. 7. Enabling the Direct Excel Connection plugin.

8. Leave the default Excel connection settings as is. The program will open or use the already opened Excel window in this case (fig. 8).

Configuring Excel connection settings
Fig. 8. Configuring the Excel connection settings.

The Excel document does not change in this tutorial. So, we configure the file name without a timestamp, with only a fixed file prefix (fig. 9). In this example, the final file name will "file.xlsx" or "file.xls" for old Excel versions. You can prepare a template document with your formatting and built-in VBA script that will process updated cell value (for example, make a history table or implement calculations based on other cells in a document).

Configuring the Excel document settings
Fig. 9. Configuring the Excel document settings.

9. Simply add a single item on the "Binding" page and specify the new variable name from step #6 and link it to the necessary target cell. Because we always write to one cell, change the "Cell to fill" parameter to "1".

Connecting a parser variable with a cell
Fig. 10. Connecting a parser variable with a cell.

10. Finally, click "OK" in all dialog windows to save the settings and complete your setup. Wait for incoming data and check how the logger will open Excel and write the extracted value to a cell.

Pro Tip Similarly, you can configure exporting data to cloud-based tables (Google Sheets) using our Google Sheets data export plugin.

Value in Excel
Fig. 11. Value in Excel.

FAQ

Can I connect other lab instruments? Do you have a list of supported models?

Yes, of course. You can click the "Plus" button in the main window and configure a new connection with another device with the fully different parser settings. We do not have a precise list because there are models on the market from many manufacturers. Usually, the model name doesn't tell us what type of interface it is.

How many instruments can be connected?

Our software can handle up to 50 similar devices on one computer. This limit significantly depends on your computer performance and the complexity of your data logger configurations. Different length meter types also decrease this limit.

Another program already reads data from my device? Can I get a copy of this data?

You can solve this problem using two methods:

  1. Programmatically. If that program works on Windows, you can install our software on the same computer and use the "Spy" mode of our logger, which you may enable in the COM port settings.
  2. Using additional hardware. You may make a special data monitoring cable and install our software on an additional computer with Windows, and connect a monitoring tap there.

Related articles: Extract and Modify Lab Instrument Data for Excel Export

Advanced OPC Data Logger - Read more about:

OPC Logger RS232 pinout and signals Cables and signals Data monitor cables