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.
Serial data acquisition in the Checkweigher Management Information System
Serial data acquisition in the "Checkweigher Management Information System"
We require a compatible ‘Checkweigher Management Information System’ software
to acquire the serial data from our present checkweighers completely
automatically without the need for operator intervention.
We would like reports to be viewed and printed on demand at any time based
upon products, batches, production runs, lines and time periods.
- Average weight checkweigher reports;
- Product summary report;
- Production run summary report;
- Overfill.
We would like the software to hold a copy of the original data in raw format,
to make the system ‘Trading Standards’ friendly format to provide us with trace
ability and a paperless environment to view current production and historical
analysis.
We would like information from the multiplexor to flow into either
Microsoft Access or Microsoft Excel fields in a systematic order.
Hardware overview

Pic.1. Serial data acquisition. Hardware overview

Pic.2. Serial data acquisition. Raw
data
captured in the Hyperterminal
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 plugin 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 contains non-printable characters
(characters in green squares on the image above) and doesn't show end of a
data block. 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.3. Serial data acquisition. Serial data
view setup
And enable the "Wrap words" option, because a data block is very
large and doesn't place in the program window.

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

Pic.5. Serial data acquisition. Raw data blocks.
It's an other view of data received. All non-printable characters
was replaced with their code like #1E, #1F and #1B. Now, it is clear, that
the data block begins with #1E#1F#1B and ends with #0D#0A#0C
(underlined by red).
Now, we are ready for configuring modules. First, please,
select the "ASCII data parser and query" plugin (pic.6, pos. 1) from
a drop-down list. Then, enable a parsing option for data received (pic.6, pos.
2) and select necessary data publication plugins. The DDE server (pic.6, pos.
3) will help to check an accuracy of the parser's configuration. The "Local
database" plugin
will create Microsoft Excel files.
Pic.6. Serial data acquisition. 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.6). A
dialog window will appear on a screen (pic.7).

Pic.7. Serial data acquisition. Parser configuration window.
A configuration process will very simple if you had examined
your data flow in the data logger window (pic.5). 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 and the field #2 is the end of him. On the pic.5 values, which
you should type have been underlined by red color. It is a good idea to have
a datetime stamp. You can simply add a datetime stamp to an each record. Just
enable the "Add date/time stamp" option in the pos. #3.
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 23 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 Exńel spreadsheet.

Pic.8. Serial data acquisition. Parser items.
You will be adding a new item by clicking the "Add item" button
(pic.8, 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 23 variables with corresponding descriptions.
You can import a data parsing items from a file by clicking a button
at position #8 on pic.8. The file with all variables you can download here (right-click
over the link and select the "Save target as..." menu item).
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 variable place, we can
ise only the most powerful method - regular expression. This method allows
to extract a data from any position of the data block by mask. This mask
can be widely transformed and adapted to characters in 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, then
data will have been converted to a 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;
- Default value - this value is being used when data can't
be extracted from a data block;
- Regular expression - In
our case we needs numbers or strings, which follows character ":" in some
of the data block. For example, a regular expression will as
following: HBATCH NO\.(\d+). Here, the expression
in parenthesis is our number, which we needs;
- Entrance position - all our values have an unique searching
mask, then a searching position of each item
is constant and equal 1.
Ok. We are going to a next tab. You can specify basic format options here
(pic.9). If you had specified the data type "String" in item's parameters,
then first two options allows you to remove blank spaces from a value. The
second option allows you convert the date time string to a field with the date
time data type. We had specified YYMMDDHHNNSS here, according to the specification
above. Detailed description of formatting characters, please, see in a help
file.

Pic.9. Serial data acquisition. Format of
items.
Other options is unnecessary in our case, because all our items has the string
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 devices 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.10).

Pic.10. Serial data acquisition. DDE server window.
Now, all variables are ready for a following usage. Now, you can export it
to any database, Microsoft Excel or Microsoft Access. You can read about it
in following examples:
Weight data logger and Microsoft
Access;
Capture a serial data to
Microsoft Excel;
Log scales weight data to Microsoft
Excel.
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).