home *** CD-ROM | disk | FTP | other *** search
- ###########################################################################
-
- !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 if desired only RETURN need be pressed. The default
- filename of <ADCLogger$Dir>.config is that of the configuration file needed
- for the main application on start up.
-
- 3.8 Loading Alternative Configuration Files
-
- Alternative configuration files may be loaded by dragging the config files
- icon onto the config dialogue box. Confirmation is required from the user
- prior to the actual loading of the new config file. Note - the current
- version does not test the loaded file for being a config file - so don't
- load any old file. This is to be corrected at a later version.
-
- ############################################################################
-
- 4 ADC Dialogue Box
-
- This dialogue box is obtained by clicking 'select' over the iconbar icon.
-
- 4.1 Display
-
- This dialogue box displays values from all active channels and updates the
- values at the time interval defined in the config dialogue box. Displayed
- for each analogue channel is its name, the voltage input, the conversion to
- real units and its units. For the button channels, only the status (ie 1
- or 0) is shown.
-
- Should the user add or delete the channels to be displayed from the config
- dialogue box whilst the ADC dialogue box is open, then this will be
- reflected in the ADC dialogue box the next time it is to be updated.
-
- 4.2 Logging Data
-
- 4.2.1 Preparation
-
- Before logging can commence, it is necessary to create the file for the
- data to be written to. Clicking on the 'Prepare Logging' icon will open a
- small save dialogue box. Drag the file icon to the desired destination, or
- type in the full pathname required.
-
- The file created is of type CSV (Comma Seperated Variable) and can be
- directly imported into a number of packages for further analysis or
- plotting. It would appear that CSV filetypes are not given an icon as
- standard under RISC OS 3.1, so a standard CSV file icon is included in the
- !Sprites file for RISC OS 2 users. I have tested it with !Eureka and
- !GraphPro.
-
- 4.2.2 Starting Logging
-
- To start logging data click on the 'Start Logging' icon. From this moment
- onwards, it is not possible to alter the logging frequency or duration, or
- the channels to be logged, so these must be previously set.
-
- Whilst logging is in progress, a field is available to show the percentage
- completed.
-
- 4.2.3 Canceling Logging
-
- At any time the logging may be terminated by clicking on the 'Cancel
- Logging' icon. There is no Confirmation of this action.
-
- ###########################################################################
-
- Known Problems
-
- 1 At high logging speeds (eg 1/sec) or with a lot of processor
- activity there can be timing errors.
- 2 Have encountered problems with timing of the logging.
-
- ###########################################################################
-
- Future Enhancements
-
- 1 Other suppliers analogue devices supported
- 2 Graphical display of input data
- 3 Averaging of ADC data to reduce noise
- 4 Add interactive help routines - important to reduce the size of
- this help file!
-
- Please send reports of any bugs/errors/suggestions for future versions.
- Information on other io devices gratefully received.
-
- ###########################################################################
-
- Version History
-
- Version 1.00 First release.
-
- Version 1.10 Configuration dialogue box added
-
- Version 1.11 Used JOBLib functions, tidied up code a bit
-
- Version 1.20 Added logging to file
-
- Version 1.22 Current Version - minor tweeks etc here and there
-
- ###########################################################################
-
- Bugs
-
- Please report any bugs/omissions for correction in any
- subsequent versions to the author at the address below.
-
- This program was written an an A440/1 with RISC OS 3.10 and
- an ARM 3. It should work on RISC OS 2 (eg no RO3 only calls
- have been used) but if not please let me know.
-
- #################################################################
-
- Warranty / Liability
-
- The author makes no guarantee of the operation of this
- program. It has been written and tested to the best of the
- authors ability, but it has not been possible to test it in
- every possible manner that any end user may put it to.
-
- In addition, it is the users responsibility to ensure that
- any interfacing to the computer does not or cannot cause any
- damage to the computer.
-
- ************************************************************
- ** IE THIS PROGRAM WILL ONLY READ FROM, OR WRITE TO, YOUR **
- ** INTERFACING HARDWARE **
- ************************************************************
-
- #################################################################
-
- Author
- Julyan Bristow
- 40, Dunard Road
- Shirley
- SOLIHULL
- B90 2HR
-
- #################################################################
-
- Copyright
-
- This program was written by the above author, and has been
- released into the Public Domain. This means that anyone can copy
- the program freely and distribute as wished. However, you must
- include all the files listed below and not alter any of the files
- in any way.
-
- IE CREDIT WHERE CREDIT IS DUE
-
- The files in this application are as follows:
-
- !Boot
- !Run
- !RunImage The application executable file.
- !Sprites The application sprites.
- Messages Application messages.
- ReadMe This file.
- Sprites The resource sprite file.
- Templates The window templates.
- Config The default configuration file.
-