home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
a
/
adclogger
/
!ADCLogger
/
ReadMe
< prev
next >
Wrap
Text File
|
1994-10-21
|
14KB
|
345 lines
###########################################################################
!ADCLogger
By Julyan Bristow
Version 1.20
###########################################################################
1.0 Introduction and Overview
This is an application to allow data to be displayed on the screen and
logged to a file using an Archimdes fitted with an analogue to digital
conversion input port. The program operates on the desktop and is fully
multi tasking.
For this particular application's development, the Acorn I/O Podule (Part
No AKA 10) was used. However, it uses legal os_byte calls, and should
therefore support any other devices that use the same calls.
###########################################################################
2.0 Starting the Program
Load the program in the normal way by double-clicking on the icon in the
filer window. The application will install itself on the iconbar.
The application loads a default configuration file on start up. If this
file is not present, or fails to load, warning messages are given and a
bare minimum configuration is created. This file is called 'config' and is
placed in the !ADCLogger directory. Should you wish to alter the location
of the default configuration file, alter the following: Edit the Messages
file. Alter the text after 'defcon:' from <ADCLogger$Dir>.Config to the
full path of your config file. If you are using !Edit, you can SHIFT-DRAG
the file and the path will be automatically inserted.
Clicking 'menu' over the icon will give a menu with three options as
follows:
Info Program version, author etc
Config Clicking on this will allow for configuration of
the displayed and logged channels
Quit Clicking on this will Quit the program. If logging
is in progress, a confirmation to quit will be
required.
Clicking with 'select' will display the analogue port display dialogue box.
I use !NewLook as supplied by Acorn for RISC OS 3.1. I have checked the
program without the !NewLook icons and some of it looks a bit naff. Sorry,
I am not going to alter it for those without RISC OS 3.1.
###########################################################################
3.0 Configuration
This dialogue box is obtained by selecting the 'config' option from the
iconbar menu.
This opens a large dialogue box which allows for two main operations: (i)
giving names and units for the analogue channels, and allowing for
conversion of read voltage to 'real' units and (ii) setting up of the
logging parameters eg the frequency and duration of the log.
For the fields where a user input is required, use the TAB key, or the up
and down cursor keys or the mouse th move to the desired field.
3.1 Channel Configuration
3.1.1 Analogue Channels
There are 4 of these available on the Acorn I/O podule. The program allows
any of the 4 to be used as desired by the user.
In order to activate a chosen channel, click on the radio icon next to the
channel to be used. This enables the channel to be toggled on or off. If
the channel is active, the name and unit of the channel can be entered in
the appropriate box.
Two further inputs are possible for each channel - Units/Volt and Zero
value. These allow for converting voltages from sensors to real units.
This applies a linear conversion, so any linear response sensor (ie one
which uses a conversion of the form y=mx+c (where y = real units, x =
measured voltage, m = constant gradient and c = zero offset) can be
applied. For example, if using an LM35 temperature sensor, its output is 0
volts at 0 Deg C and 1 volt at 100 Deg C. Thus Units/Volt = 100.0 and Zero
value = 0.0.
If the dialogue box is to display voltages, the Units/Volt should be 1.0
and Zero value 0.0.
3.1.2 Button Channels
There are two button channels available on the Acorn I/O podule. As with
the analogue channels, either of them may be selected for display with the
radio icon. If selected, a name for the button channel may be entered.
The buttons are displayed as either 1 or 0 for on or off.
The button channels are not saved to the file.
3.2 Display and Logging of Channels
If any of the ADC channels or buttons are selected or deslected, they are
seen immediately in the analogue port display dialogue box (see below).
However, if a channel is to be logged to disc, only those channels selected
at the time of starting the logging are recorded. Ie if a log has already
been started, selecting or removing channels from the display window will
have no effect on the channels being recorded.
3.3 Reference Voltage
There is a field available for setting of the reference voltage as used on
the Acorn I/O podule. This is not very stable on the board and can drift
with time. This field allows the user to set the value of the reference
voltage to that of their particular board. It is also possible for the ADC
chip used on the I/O podule to have a reference voltage applied to it of
upto 2.5 Volts (ref - RS cataloge), and so some users may have applied
thier own reference voltage different to that on the podule. This allows
for this eventuality.
The application converts the input to a voltage as follows:
voltage = (read ADC steps / 65536) * reference voltage
3.4 Setting Logging and Display Timings
3.4.1 Timing of Updates
This application is fully multi tasking. Ie it polls the WIMP and claims
NULL events. On each NULL event it compares the time at that instant with
the time of the previous event. If that is equal to or greater than the
required interval, then a measurement is logged to disk or the screen
updated. For most of the time therefore, the data will be logged/displayed
at the correct frequency. However, at times there can be great demand on
processor time (eg formatting disks, complex rendering operations etc) and
so the data could be recorded at a greater interval than that required. As
the logging is controlled by software, then there is nothing that can be
done about this I'm afraid.
3.4.2 Display Update Interval
The values read from the active channels are updated on the screen at an
interval defined by the user. This may be from 1 second upwards. Use the
up arrow to increase the time and the down arrow to decrease.
3.4.2.1 Logging Interval
The logging interval may be selected in seconds, minutes or hours by
clicking on the appropriate radio icon. When selecting a different unit of
interval, the time interval is converted to the appropriate unit. For
example if the logging interval is set to 60 seconds, and then the minute
interval selected, the displayed interval will be 1 minute, similarly if an
interval of 1 hour has been selected, and then the seconds interval chosen,
3600 seconds will be displayed.
Each individual time interval may be set independantly and there is no
maximum limit ie 120 seconds can be set as can 2 minutes.
Once logging has started, these times cannot be altered.
3.4.2.2 Logging Duration
The duration may be defined in 4 ways: (i) as the number of values to be
collected, or (ii) the time for which logging is to take place over, for
example there may be 600 values recorded at a frequency of 15 seconds, or
readings every 15 seconds can be taken over a time of 10 minutes (giving
10*60/15=40 readings) etc.
Once logging has started, the duration cannot be altered.
3.5 Update of of Data
Clicking on this icon will update the application with the names, units and
conversions for each ADC channel and the button information. Timing
information is always up to date.
3.6 Canceling Changes to Channel Descriptions
Clicking on this icon will close the dialogue box and not update the ADC
channel and button information. Timing information is always up to date.
3.7 Saving of Configuration File
Clicking on this icon will open a small save dialogue box. Drag the file
icon to the desired destination, or type in the full pathname required.
The default path is the !ADCLogger directory (via the system variable
<ADCLogger$Dir>, so i