Writing data to an XLS file without Excel with help of "Local database" plug-in
Task:
We are filling bags of powder on a 6 head filling machine and require to
record each bag weight as it comes off the filling machine. We would like to have data sent directly into a Microsoft Excel spreadsheet.
An each
weight recorded to be in a row. Each log file for each day to be a new
spreadsheet. Each new sheet is to be labeled as the day of the
data recording. Typically there will be
approximately 1000 recorded data entries for the production for the day.
We only require the "date" and "head weight" figure to
be inserted into the spreadsheet.
Requirements:
- Advanced Serial Data Logger (ASDL) Professional or a trial version;
- ASCII data parser and query plug-in for the data logger;
- DDE server plug-in for Advanced Serial
Data Logger (optional);
- Local database plug-in for the data logger software.
It is assumed that:
You've prepared parser items for export.
For this tutorial all items were prepared in the previous part.
Also you may read other examples:
- Parsing data from barcode scanner and writing to a log file with a date/time stamp (data at fixed positions, no data packet signatures);
- Processing data from barcode scanner (data at fixed positions, data packets with the end signature);
- Parsing data with help of regular expressions (complex data format, regular expressions, data filter);
- Receiving and parsing data from aircraft engine monitor (usage example, custom data parser);
- Processing data from the lab equipment (simple data format, regular expressions);
- Receiving and parsing data from Garmin Geko301 GPS receiver (simple data format, data at fixed positions, data packets with both signatures);
- Parsing data from the filling machine (simple data format, delimited data, data packets with the end signature, data filter);
- Parsing and processing data from PBX (simple data format, data at fixed positions, data packets with the end signature, data filter);
- Logging and parsing data from an intellectual pressure measuring device (sending requests to the device, simple data format, data at fixed positions, data packets with the end signature, data filter);
- Serial data acquisition in the Checkweigher Management Information System (complex data format, regular expressions, filtering data);
- Serial port data aggregation. Combine a data of two different com-ports (simple data format, data at fixed positions, data packets with the end signature, data filter);
- Weight data logger. Parsing weight data from scales (simple data format, data at fixed positions, data packets with the end signature, data filter).
- Send data to a port from a file (data requests, send data by a schedule).
Solution:
All parser items are now ready for export to "Local database" plug-in. Please, open the configuration window of the "Local database" plug-in (fig.1) by selecting the module in a list and clicking the "Setup" button on the "Data export" page.

Fig.1. Export to Excel. Selecting a database.
Just select a database type in the field #1, in the field #2 type or select a path, where new files
will be created and specify a file name prefix in the
field #3.
On the next tab, you should specify basic format options as per fig.2.

Fig.2. Export to Excel. Format options.
Because one of our variables has the "float" data type, then we should specify a necessary
decimal separator in the field #1. The next variable has the "time" data type, therefore
you should specify a time separator in the field #2 and the option in the field #3 too. The option at the pos.3 allows you to add leading zero before hour, month or year digits. Other options are unnecessary in our case, because we don't use other data types.
On the last page "Columns order" (pic.11) you can specify,
how our variables will be being placed in a spreadsheet. Because we need 2
variables only, therefore, please, create 2 items on this page by pressing
the "Add item" button (pic.11, pos.5).

Fig.3. Export to Excel. Column order options.
Any new items may be added by clicking the "Add item" button (Fig.3, pos. 5). Before adding an item the program will ask you about an item description. You can type any characters here, which will help you to remember a variable's content. For this example 2 variables with their corresponding descriptions have been added.
Each data export item has a number of properties:
- Parser item name - is a
parser variable name, which you have created in the parser configuration.
You may select a variable name from a drop-down box or type this name manually;
- Column order - is a column number in a spreadsheet for this variable.
The minimum value is 1;
- Column length - is a column width in a spreadsheet.
You may change this width in Microsoft Excel later.
Click the "OK" button and close the local database plug-in configuration
window and the "OK" button in the options window.
Okay, all settings have been completed and we are ready to capture weight data from
scales to an Excel file.