The publications in this collection do
not reflect current scientific knowledge
or recommendations. These texts
represent the historic publishing
record of the Institute for Food and
Agricultural Sciences and should be
used only to trace the historic work of
the Institute and its staff. Current IFAS
research may be found on the
Electronic Data Information Source
site maintained by the Florida
Cooperative Extension Service.
Copyright 2005, Board of Trustees, University
GULF COAST RESEARCH & EDUCATION CENTER
'IFAS, UNIVERSITY OF FLORIDA
5007 60th Street East
Bradenton, FL 34203
Bradenton GCREC Research Report BRA1985-16 February 1985
"GATHER": A BASIC PROGRAM FOR DATA COLLECTION USING
A PORTABLE MICROCOMPUTER
James P. Gilreath
Abstract. A computer program was developed which allows a relatively in-
expensive ($1,000) portable microcomputer to be used for data collection
and uploading of data files to a host computer. The program is written
in MBASIC and requires 8.5K bytes of memory. The menu driven program provides
prompts and error handling capabilities to make the program user friendly.
Data collection and analysis are time consuming processes. Each time
data are transcribed the probability of error increases. Electronic data
collection devices are commercially available; however, they are relatively
expensive (>$2,000). In addition, they may require some programming by
the user or else purchase of program 'instructions in the form of read only
memory (ROM) chips. With the shrinking budgets which most are experiencing,
many individuals can not afford to'invest in one of these devices. Several
lightweight portable computers are now available for under $1,000. Among
these is one sold by Radio Shack under the trade name TRS-80 Model 100
(Radio Shack, a division of Tandy Corporation, Fort Worth, TX, 76102) which
can be purchased with different amounts of memory and comes with a phone
modem for telecommunications, an RS-232C interface, a text editor and resident
MBASIC (Microsoft Corporation, 10700 Northrup Way, Bellevue, WA 98004)
programming language. MBASIC is a relatively common version of BASIC which
is available for a large selection of computers. The Model 100 could thus
be used for data collection, text preparation and programming applications
in BASIC. Currently no menu driven data collection programs are available
for the Model 100 or any other portable computer.
This paper describes an MBASIC program developed for the Model 100
which was written to provide a low cost, menu-driven alternative to expensive
commercial data collection devices and to serve as a component in the ultimate
goal of complete automation of data collection and analysis, including
tabulation of results. The program requires approximately 8.5K bytes of
memory and allows the computer to be used for data collection and uploading
(transferring) of data files to a host computer via telephone hookup or
direct connection through the RS-232C interface. The program, consisting
of seven function modules, is stored in the computer as' a BASIC program
called "Gather" and is run by selecting that file. The Model 100 was selected
because it is easily obtainable with varying quantities of memory, can
usually be serviced by Radio Shack at one of its local service centers
rather than having to be shipped back to some distant manufacturer, is
low cost, has a convenient size screen and a well designed typewriter size
keyboard and provides other useful functions such as a text editor for
As mentioned, there are seven function modules or modes included in
the program. These modules (Table 1) provide the following functions:
1) command summary menu returns the user to the main menu which lists
all the available functions; 2) data collection mode allows for menu-driven
data collection; 3) saving of the data file in memory once all data have
been entered; 4) review of data one electronic page at a time, paging forward
or backward, with all data for each experimental unit constituting a single
page; 5) another review function which scans the data file for any missing
entries and lists them; 6) a module which allows for retrieval of data
from on-line storage; and 7) a temporary halt during data collection which
allows one to turn off the machine without losing unsaved data and starts
up where the user left off when the computer is turned on again. Error
checking routines are provided throughout to eliminate or identify errors
and allow the operator to continue. Mathematical functions are also provided
during data collection in order that one may add, subtract or calculate
average values for data, such as harvest data where the yield exceeds the
weighing capacity of the scale and must be weighed in several lots.
The program begins with a request for initial information on the data
file by prompting the user for the numbers of treatments, replications
and data sets (dependent variables) to be entered (Fig. 1). The user is
then given the option of changing any of the above entries. In the next
step, the computer performs the internal process of dimensioning the arrays
created from the input provided by the user. Once the arrays are dimensioned
the user is prompted to name each data set after which the screen clears
and the command summary -menu is displayed. To input a command the user
is instructed to press the "enter" key, which places the program in command
prompt-mode, followed by depressing the "control" key and the letter which
represents the command selected. If the letter "H" is selected the.program
returns to the command summary menu and proceeds as described. Selection
of "E" allows the user to begin data entry. "R" is a review module that
allows the user to view the data sets one treatment-replication combination
at a time. Entering "K" dumps the file to internal RAM (random access
memory) storage, thereby saving the data, then clears the screen and awaits
the next command from the menu. Selection of "L" instructs the computer
to check the file for missing data points and display all elements with
missing values. "G" module allows retrieval of data from on-line RAM storage
and "Q" calls up a subroutine which temporarily turns the computer off
until manually reset.
If the user chooses to begin data entry, he is prompted to select between
two primary modes of entry: master or novice. Novice, though a bit longer,
provides the user with a wealth of information and options on each screen.
Master permits the user to enter data, with a minimum of keystrokes and
informational messages or prompts. Master also makes available certain
"priorities," or patterns which the user may select in order to further
reduce the number of keystrokes. These priorities consist of "treatment,"
"replication," and "data set" priority. Treatment priority allows entry
of data in any combination or order, affording the user maximum control
or flexibility. Thus, one could enter data for treatment 1, replication
3, data set (variable) 2 and immediately follow that entry with the entry
for treatment 2, replication 1, data set 3. Selection of replication priority
allows the user to designate which replication, data set in which he or
she would like to enter data, but it does not permit moving to a different
treatment until all the replication, data set entries have been completed.
Data set priority offers the least control, permitting flexibility only
with respect to the data set number, and requires the least number of key-
strokes. All data sets within an experimental unit (treatment, replication
combination) must contain entries before the user can specify another exper-
imental unit. Data set priority is most useful in cases where data for
all data sets (variables) will be collected from each experimental unit
before collecting data from any other unit.
Selection of data entry by the novice mode begins by prompting the
user to enter the treatment and replication number for which he is about
to enter data. The computer then displays all previously entered information
about the particular treatment-replicate combination and instructs the
user to depress any key to continue. The next prompt is for selection
of the data set choice and is accomplished by entering the numeral which
represents that data set. The screen then clears, displays the data set
number and name and allows for entry of the data. Once data for that variable
have been entered the screen then displays a list of options which provides
the user with a choice of selecting to enter another data set for that
treatment-rep combination, entering data for a new treatment-rep combination
or returning to the command prompt mode. The user can select another function
module, such as saving data in memory.
Should the user choose to enter data under the master mode, he is prompted
to select between the three "priorities" before proceeding. Data collection
then proceeds in the manner previously described under the three priority
Once data entry is completed, the user returns to the command summary
menu, enters command prompt or selection mode and presses the appropriate
keys to save the data file. The file may then be inspected for missing
data points or the data reviewed' as previously described. If the user
chooses to review data (module "R"), the program allows for viewing of
all data sets, one treatment-replicate combination at a time, beginning
with the first treatment and first replicate and ending with the last treatment
and replicate. The viewing is thus similar to leafing through the pages
of a book and can proceed forward or backward by simply entering either
a "+" or a "-", respectively. At any time the user may exit this module
by entering ."E" and the program then returns to the command summary menu.
Forward or backward movement through the treatment-rep combinations proceeds
through either an increment or decrement counter which keeps track of the
current location in the data file. In this review module the data file
exists as an endless loop. Thus, when the upper limit of the data file
is reached, continuation of review proceeds into the beginning of the file.
If review is proceeding in descending order, the end of the file is accessed
once review proceeds beyond the beginning or lower limit of the file.
Should the user elect to have the computer check the entire file for missing
data points, he selects "L" and the computer proceeds, recording the location
of each missing data point. When one screen full of missing entries has
been displayed, the computer displays a prompt inquiring of the user whether
or not he wishes to continue reviewing the data file. This is accomplished
by having an increment counter in the subroutine of this module and setting
the treatment, replication and data set counter at one initially. As the
computer proceeds to check for missing data points, it records the location
of missing values one data set at a time and proceeds in a loop through
an increment counter until no more: data sets are encountered. After the
file has been checked the screen displays all elements with missing values
and allows the user to select the next module from those identified in
the command summary menu.
Retrieval of a data file from on-line storage (module "G") proceeds
by specifying by keyboard input the name of the file to be retrieved.
If the file is located, the computer returns to the command prompt mode
in the program, allowing the user to select from the various other function
modules. Should the file not be located, this is indicated on the screen
and the computer returns to the command summary portion of. the program
and awaits additional instructions.
Frequently in research one encounters the problem of missing data where
experimental units have inadvertently been damaged or destroyed or otherwise
rendered useless. This problem is taken into consideration in "Gather."
Should missing data be encountered, the user enters "@" to denote a missing
value. This will.be considered a valid entry when the data file is reviewed
for missing entries via the built-in review function. In addition, when
the data file is processed by a second computer program (to be described
in a subsequent manuscript) which creates a formatted SAS (Statistical
Analysis System) data file, missing entries, denoted in this manner, appear
as blank spaces and not as a series of zeroes which would represent.actual
data with a value of 0.
As indicated, various error checking subroutines are built into the
program. It is virtually impossible to enter an alphabetical character
for data,.or a treatment or replication number for a treatment or replication
which does not exist. All entries are checked to see if they are about
to write over some previously entered data, and if they are, the previous
entry is displayed on the screen as well as a request for user approval
to overwrite the entry.
There is a built-in limit of 17 data sets which can be included in
any -one data file. iThe number of 'data files which can exist in RAM is
limited only by the amount of available memory. Even large data files
require very little memory since they are stored as three dimensional arrays.
Thus, a Model 100 with 24K bytes of memory could retain "Gather" and a
number of data files in memory and still have considerable memory available.
Whenever the user is ready, he may upload the data file to a host computer
for analysis by telecommunications using the built-in phone modem or by
direct connection to a mini- or microcomputer via the RS-232C interface.
Once the necessary communication protocol is established, the data are
transmitted in standard ASCII (American National Standard Code for Information
Data collection using this program in the Model 100 proceeds at approxi-
mately the same rate as by conventional pencil and paper methods; however,
the speed and accuracy of subsequent data handling steps is far superior.
Experiment results which once required. several hours to obtain are now
available in a matter of minutes.
The author wishes to express his deepest appreciation to Mr. Gregory
V. King for his valuable technical assistance in writing this program narr
preparation of this manuscript.
This program was developed as part of a project that contributes to
a joint program between the Institute of Food and Agricultural Sciences
(IFAS) of the University of Florida and the Gas Research Institute (GRI),
Chicago, Illinois, entitled "Methane from Riomass and Waste."
Table 1. List of function modules available in "Gather" and related
keyboard entries to access them.
Command summary menu
Save data file
Review of data file by experimental unit
List variables with missing data
Retrieve data file from on-line storage
Temporary halt to program execution
Kevbord enrv Fuctio