|
There are a few types of instruments that transmit data
either continuously or in bursts with many data values arriving
in succession over a short period of time. For example many
older electronic balances were designed to transmit continuous
data to a digital display so that you could watch the weight
reading change on the display. They typically transmit up
to 10 weight values per second and do not provide a way to
stop the data from flowing. (Most newer balances are configurable
to transmit data only in response to a prompt sent through
the serial port or by pressing a "Print" button
on the balance. This is the best way to use a balance with
the Wedge.) There are also some devices like tensile strength
testers or friction peel testers that perform a test over
a short period of time and for the duration of the test they
transmit a large number of data values.
Although you may not be able to configure the device to
send less data, you may be able to configure the Wedge to
ignore enough of the readings so that you are not overwhelmed
with data.
One way to do this is to configure the Wedge to treat multiple
data records as one long record containing multiple fields
and then simply ignore most of the fields. For example, most
electronic balances simply transmit a weight reading followed
by a carriage return and a line feed character. Normally
you would define the "Input Data Record Structure" with "Carriage
Return or CrLf Received" as the "End of Record
Event" and then specify "Single Field Data Records" as
the "Record Structure" for this type of data. If
instead, you chose "Multiple Delimited Data Fields" as
the "Record Structure" and chose the Carriage Return
(ASCII 13) as the delimiter and also specified 30 for the "Maximum
Number Of Data Fields" and finally chose "Ignore
This Field" for the filters for Fields 1 through 29,
you would effectively remove 29 out of each 30 data readings
transmitted by the balance. If the balance sent ten readings
per second, the Wedge would only pass a single reading through
to another application once every three seconds.
Another way to control continuous data is to configure the
Wedge so that it is initially suspended when you first activate
it (select the "Activate Initially Suspended" option
from the Activate menu). If the Wedge Activated but is suspended,
it will continue to input serial data into its input buffer
however it will not pass any data to another application
until you resume it. Next, you could define one hot key that
resets the Wedge and then define another hot key that resumes
the Wedge for one data record. You can even assign both hot
key actions to the same hot key keystroke so that both the
reset and the enabling for one record is accomplished with
the same keystroke. After you activate the Wedge it will
not do anything until you press your hot key. When you press
the hot key, the Wedge will reset itself (causing it to flush
its input buffer) and then it will enable itself for one
data record. After the next record is received, the Wedge
will suspend itself again.
If you use the above technique, make sure that you select
a "Start of Record Event" that will reliably determine
the beginning of each data record (i.e. do not select "Any
Character Received" as the Start of Record Event) .
The reason for this is because if the device is in the middle
of transmitting a data record when you press your hot key,
the reset hot key action causes the Wedge to clear out its
input buffer thus chopping off the first half of the data
record being received. If you had "Any Character Received" selected
as the Start of Record Event, the second half of the data
record would be received as if it were a complete record.
Choosing "Special Character Received" as the Start
of Record Event and using the Line Feed (ASCII 10) as the "Special
Character" would be a good choice in this situation.
Since the device is transmitting a continual stream of data
records with a carriage return and a line feed at the end
of each data record, you could just as easily think of the
line feed as the start of each record and the carriage return
as the end. To remove the line feed and the carriage return
from each record, you can use either the "Pre-Transfer
Character Translation Table to translate them to "Nul" or
you can apply a "Numeric Data Only" filter to the
field(s) in the Wedge that contains them.
More Cool Wedge Tricks
|