specify the printer port that is connected to the ADC-100
take a single reading from a specified channel
specify a trigger event from a specified channel (only available in block mode)
collect a block of samples at fixed time intervals from one or more channels
You can specify a sampling interval from 10us to a second. If you specify an interval that is shorter than
your computer can manage, the driver will tell you how long it will actually take to collect the specified
number of samples. After allowing for this, the timing accuracy under DOS is better than 1% for a block of
1000 samples at all sampling rates.
Under Windows, if you connect the product to the computer via a PICO USB parallel port, timing is
completely reliable. However, if you connect the product to the computer via the printer port, the sampling
may be affected by Windows activities. At the least, there will be gaps in the data every 55 milliseconds
due to the Windows timer function. There will be additional gaps if you move the mouse, or have other
programs running. We therefore recommend using the adc100_get_values_and_times routine, so that
you can determine the exact time that each reading was taken.
The normal calling sequence to collect a block of data is as follows:
Check that the driver version is correct
Open the driver
Set trigger mode (if required)
Set sampling mode (channels and time per sample)
While you want to take measurements,
Run
While not ready
Wait
End while
Get a block of data
End While
Close the driver
Scaling
The ADC-100 and ADC-101 are 12-bit analog to digital converters. This means that they produce values in the
range 0 to 4095 to represent the currently selected input voltage range. To convert from ADC readings to Volts,
you should subtract half of the 2048, multiply by the currently selected voltage range and divide by 2048. Thus,
on the 5V range, an ADC reading of 3135 represents (3135-2048) x 5 / 2048 = 2.654 Volts.
adc100_get_driver_version
PREF1 short PREF2 adc100_get_driver_version (void);
This routine returns the version number of the ADC100/101 driver. You can use it to check that your
application is used only with the driver version that it was designed for use with.
Generally speaking, new driver versions will be fully backward compatible with earlier versions, though the
converse is not always true, so it should be safe to check that the driver version is greater than or equal to
the version that it was designed for use with.
The version is a two-byte value, of which the upper byte is the major version and the lower byte is the
minor version.
adc100_open_unit
Komentáře k této Příručce