for Windows 9x/Me/NT/2000/XP x86,x64/2003 x86,x64/Vista x86,x64. Latest version: 3.2.3 build 21. May 29, 2008.
Barcode scanner data logger. Capture a barcode data from a serial port
Task:
We are receiving barcodes (EAN-13) from a serial port. We have some barcode
scanners connected, each one send data, when read. The data contains: its identification
number (the first character) and barcode information (thirteen digits).
When the Advanced Serial Data Logger receives the information from the serial
port, he adds a date and time stamp. In a log file this information is registered
correctly, but we should create other ASCII file with different structure in
the CSV format.

Pic.1. Barcode scanner
data captured by the serial
data logger software
Requirement:
- Advanced Serial Data Logger (ASDL) Professional or a trial version;
- ASCII data parser and query plugin for Advanced Serial Data Logger;
- DDE server plugin for Advanced Serial
Data Logger (optional);
- Local database plguin for Advanced Serial
Data Logger.
It is meant:
You had configured communication parameters (baud rate, number of data
bits, flow control etc) in ASDL and can receive any data without communication
errors.
Solution:
The image above shows, that a data flow is very simple. Each record has a
fixed size and a fixed position of each item. We need one -
the end of an each data record. We need analyze it. We'll enable a display
output for non-printable characters with a code below that 20 Hex. Please,
set following options.

Pic.2. Serial data view setup
Click the "OK" button and try to receive data from
a serial port. You'll get same as on an image below.

Pic.3. Barcode scanner data logger. Data received.
It's other view of data received. All non-printable characters
were replaced with their code like #0D. Now, it is clear, that the data block
(in a green rectangle) ends with #0D (underlined
by red).
Now, we are ready for configuring modules. First, please,
select the "ASCII data parser and query" plugin (pic.4, pos. 1) from
a drop-down list. Then, enable a parsing option for data received (pic.4, pos.
2) and select necessary data publication plugins. The DDE server (pic.4, pos.
3) will help to check an accuracy of the parser's configuration. The "Local
database" plugin
will write data to the ASCII file with the CSV format.
Pic.4. Barcode scanner data logger. Plugins setup.
Now, please, open the ASCII parser and query configuration window
(click the "Setup" button near a drop-down box pos.1 on pic.4). A
dialog window will appear on a screen (pic.5).

Pic.5. Barcode scanner data logger. Parser configuration window.
A configuration process will very simple if you had examined
your data flow in the data logger window (pic.3). You should type same as in
the data logger window in fields 1 and 2. The field #1 is the beginning of the
data block (this field is emptyin our case) and the field #2 is the end of
him. On the pic.3 a value, which you should type have been underlined by red
color. The field #3 is empty, because our data flow doesn't contain data blocks,
which should not be being analyzed.
Ok. We are going to a next tab. It's the very important part
of the parser configuration. Parser uses this information for data extracting
from a data block. Our data block contains 2 data items, which should be separated
to different variables. Later, these variables will be used in the data publication
and will be placed in different columns of our CSV file.

Pic.6. Barcode scanner data logger. Parser items.
You will be adding a new item by clicking the "Add item" button
(pic.6, pos. 7). 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. We had added all 2 variables with corresponding descriptions.
Each parser item has few properties:
- Item name - this name you'll bind with a column in the data
publication plugin. It's a short representation of description and can't
contain spaces or few other characters;
- Parser's type - it's a method, which the program will
use for data extraction. Our parser has few methods from simple to most powerful.
In our case, where data is being placed in fixed place,
we can use one simple method - fixed position.
This method allows to extract any number of characters from any fixed
position of the data block;
- Data type - the data type of characters extracted. You
can specify a real type of your data or specify the STRING data type, and
then data will have been converted to other type later, in the data publication
module. The data type here is being used on formatting of the value, by the
way is being specified on "Data formats" tab. Our "Weight" field
has the Float data type, the "Number" field - the Integer data type,
the "Date"
field - the String data type (because the plugin can't convert our string date
to the date data type);
- Default value - this value is being used when data can't
be extracted from a data block;
- Fixed position - It's a position of first variable's
character in our data block. A minimum value is 1;
- Fixed length - It's a number of characters, which will
be copied to a variable. A minimum value is 1.
The second item has same parameters, just a position and a length is other.
Ok. We are going to a next tab. You can specify basic format options here
(pic.7). Because we had specified the data type "String" in item's
parameters, then first two options allows you to remove blank spaces from a
value. Other options don't require in our case.

Pic.7. Barcode scanner data logger. Format of items.
Other options are unnecessary in our case, because all our items don't have
the date and datetime data type.
Click the "OK" button and close the parser configuration window and the "OK"
button in the options window.
Now, our parser is ready. And now, it's a time for testing it. Connect your
device and/or power it on and try to receive a data block from a serial port.
If the parser had been correctly tuned up, then in the DDE server window you'll
see our variables' names and their value (pic.8).

Pic.8. Barcode scanner data logger. DDE server window.
Now we are ready for configuring the Local database plugin. It's very simpe.
Please, open the configuration window of the Local database plugin (pic.9).

Pic.9. Barcode scanner data logger. Selecting a database.
Just select a database type at the field #1, input a path, where new files
will be being created in the field #2, specify a file name prefix in the
field #3 and setup options of your type of a CSV file with options #4.
It's all other options are optional. On the second page "Data formats" you
can specify a representation of your data. Because all our variables is with
the "string" data type, therefore it is unnecessary in
our case. On the last page "Columns order" (pic.10) 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.10, pos.5).

Pic.10. Barcode scanner data logger. Column order options.
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.
Each parser item has few properties:
- Parser item name - it's a parser variable name, which
had been created in the parser configuration. You need select a variable
name from a drop-down box, which appears while clicking on a link of this
property;
- Column order - it's a position of a variable in a spreadsheet.
A minimum value is 1;
- Column length - it's a column width. This options isn'
require in our case, because we are using a delimited CSV file.
Click the "OK" button and close the local database plugin configuration
window and the "OK" button in the options window.
Ok. All settings had been done and we are ready for capturing barcodes.
Related articles:
Capture a serial data to a Microsoft Excel spreadsheet with regular expressions;
GPS data logger;
Weight data logger to a Microsoft Access database (data at a fixed position);
Barcode scanner data logger. Capture a barcode data from a serial port;
PBX data logger. Capture a serial data from PBX systems;
Log weight from a scale to a Microsoft Excel spreadsheet (data at a enumerated position);
Pressure data logger. Log data from an intellectual pressure measuring device;
Serial data acquisition in the Checkweigher Management Information System.
[NEW] Aircraft engine monitor (example of an usage).