Comms Coster

by Lee Calcraft

The purpose of CommsCost is to automatically monitor the
serial port of your computer, and calculate the size of the
telephone bill that you are running up. It keeps a running
total of the number of units used, the time on line, and the
total costs incurred.

All charge data is read in from a customisable data file,
and the program also displays a countdown to the start of
the next telephone unit, so that you can minimise your bills
by going off line just before the present unit runs out.
There is also a manual option enabling the program to be
used for non-comms phone calls.

All the data is displayed in CommsCost's main window, but if
you want to keep the desktop uncluttered, you can run
CommsCost with the window closed, since the icon bar icon
displays the most important information: units used and time
to the next unit.

Note however, that CommsCost has no way of automatically
knowing who originated the call, and will start counting
costs even if you are receiving a comms call (for example if
you are running a bulletin board). Also CommsCost will not
work with ArcFax, or other fax handling software because it
has no way of knowing when you are on line.

Running CommsCost
To run CommsCost, either double-click on the icon in a
directory viewer, or click on its icon in the Master Menu
system. This will install an icon on the icon bar, and open
the main window. The display is split into two columns: the
running total and the data for the current call. When you
are on line, only the current data is updated. But as soon
as you go off line, or quit the program, the current data is
added to the running totals. At the same time the running
totals are saved to disc (in a file called Totals).

At the base of the main window are four radio icons. These
allow you to select the charge band for the call. The first
three are standard BT charge bands while the fourth is a
customised band, which could be used for foreign calls, or
for calls using a different telephone network. The data for
all the charge bands is held in the file Charges, and in
fact all four charge bands could be customised if required.
The format of the file is pretty self-explanatory, but
further details are given at the end of this piece.

Automatic or Manual Operation
The icon bar menu (click Menu over the icon bar icon) allows
you to set CommsCosts to one of three types of operation:
  Manual
  Auto ring or
  Auto dcd
By default it is initially in Auto ring mode. This means
that if you are using an Archimedes type comms lead, it will
automatically detect when you go on or off line.

If you are using a PC type lead (as now supplied with most
modems for use with the more recent Archimedes and the Risc
PC) you should set the Auto dcd option.

Alternatively, if you select Manual, you can force the
program to start charging by clicking the icon bar icon with
Shift held down. To end the charging click on the icon with
Ctrl held down. This is useful if you want to use CommsCost
for ordinary telephone calls.

Problems
If CommsCost is not detecting that you are on line after you
have received a Connect from the host computer, first of all
check the state of your serial port using CommStat (Risc
User disc 8:0). This should show that either the Ring or the
DCD line is registering your going on and off line.

If this is not happening it may be that &C1 is not set on
your modem. To set this, type:
  AT&C1
from within your comms package, assuming of course that you
have a Hayes compatible modem. Then save your settings to
non-volatile RAM.

Save Choices and Reset
These two further menu options do as you would expect. Reset
simply resets all the running totals to zero, while Save
choices saves to disc the charge band currently in use, the
current mode of operation (whether manual ring or DCD), and
also whether you have the main window open or closed. If the
window is closed when you make a Choices save, then
CommsCost will start up in future without the main window
open.

The Icon Bar Display
The icon bar display changes when you go on line. When you
are off line it displays the running total of units used.
When you go on line, the icon chages to a 'hot' serial
connector, and displays a combination of the number of units
used on the current call (to the left) together with a
countdown of the number of minutes and seconds remaining on
the present unit. The width of the display is eight
characters, so in the unlikely event that any given call
exceeds this, the rightmost digit will be stripped off.

Comms Time Delay Adjustment
The only way in which CommsCost can know that you are on
line is to check for the state of certain lines on the
serial port. Unfortunately these only register when a comms
dialogue has been set up. This can take five or ten seconds,
depending on the dial-up host. To take this time into
account an adjustment factor has been included in the comms
Charges file. It is the third piece of data in the file
(on the fifth line), and is currently set to 1000
centiseconds (10 seconds). If your usual host takes either
more or less time then you should adjust the figure
accordingly. If it is five seconds, then use 500 in the data
file. Remember that this should be set to the time it takes
CommsCost to register that you are on line once the call has
been answered by the distant modem. Note that if you are
using CommsCost in Manual mode, the adjustment factor is
ignored.

The Charges File
You should only need to alter the Charges file to change
the time delay adjustment (see above), or the custom
charge band. Though obviously if the BT rates on which the
figures are based alter, then you may need to do some
further tinkering.

The file, which is only read when CommsCost starts up,
consists of groups of numbers in ASCII format. The first
three supply the file version number (which must not be
altered), the cost of a single phone unit in thousandths of
a penny including VAT, and the time delay adjustment factor
in hundredths of a second.

There then follows four sets of data for the four charge
bands, each containing four entries. The first is the number
of centiseconds for each unit in an off-peak call. The
second is the number of centiseconds you get for a unit at
peak times. The third is the number of centiseconds you get
for a unit over the weekend period; while the fourth gives
the time band during which the peak rate is applicable.

All valid data lines must begin with a digit. Comments may
be included providing they are preceeded by a semicolon, and
are placed on a valid data line. Here are the first few
lines of the file:

1          	;file version number

4935       	;unit cost in millipence

1000       	;time delay before link established

22000      	;L cheap centisecs per unit
8000       	;L peak
22000      	;L weekend
0800-1800  	;L time of peak charges

etc.



Text and Software  Lee Calcraft 1994
