Typical program implementations – Vernier LabPro User Manual
Page 10

Revision Date: 08/02/02
LabPro Technical Manual
10
on the calculator.
•
Calculator user can use the DataMate program to Save, Load and Delete data sets in the FLASH
archive. This can be very useful for performing and retaining multiple experimental trials in the
field. Directions for using this feature are given in the DataMate Guidebook.
•
You can write a program to review the list of stored data sets and retrieve the desired one for
further analysis. (See the sample archive program.)
•
Calculator users can use the DATADIR program (available on the TI web site at
http://education.ti.com/calc
or the Vernier web site
http://www.vernier.com/calc
) to manage
FLASH memory. Directions for using the DATADIR program are given in the DataMate
Guidebook.
Command 201, in conjunction with the Link menu on the calculator, provides access to these FLASH
archive operations. For details about Command 201, see the LabPro Command Summary section.
Typical Program Implementations
Analog Data Collection
Analog data collection is the easiest to learn and will be introduced in the next two sections.
Here is pseudo-code for a very simple LabPro data-collection program. This program takes readings from
a Vernier Barometer sensor. It will take 50 readings, 0.25 seconds apart. The general pattern is that you
transfer lists of numbers (commands) to LabPro.
0
1,1,14,0,0,1
4,1,1,8.729,8.271
3,0.25,50,0,0,0,0,0,1
Get analog data
Get time data
We will go over the program one command at a time below:
The first command initializes the LabPro using a Command 0. (Remember that the first number in the
command is the command type.) This is good practice prior to setting up data collection or when changes
take place. This command clears data, channel assignments and data collection modes that are currently
assigned in LabPro. However, this is not to say that a reset should always be sent to LabPro. In fact, since
reset clears previous data, it is important to send reset only when you are sure the user is finished with the
current configuration and data.
The second command configures the channel for reading data. Command 1 tells LabPro a number of
things about how data is to be collected. The official syntax for this command, when used with sensors, is:
1, channel, operation, post-processing, delta, conversion
You may not require all these features and you will rarely use some of them. (Use zeros, or leave them out
so the default value is used.) Here are the commonly used parameters:
channel = The input channel is specified with the second number in the list. For analog sensors, you
can use 1, 2, or 3, or 4 (for CH1, CH2, CH3, or CH4). For a motion detector you use 11 for a Motion
Detector connected to DIG/SONIC1 or 12 for DIG/SONIC2.
operation = The third number in the list provides more specific information regarding the channel
setup. This includes input selection (each analog port has two inputs) and use of internal conversion
information. In this example, we use a 14 to indicate that for this port, LabPro should collect voltage
data from the 0 to 5 V input. Most of Vernier analog sensors use this input. Many of Vernier sensors