
 Uninterruptable Power Supply (UPS) Monitoring function allows HyperDisk
 to change to a safe caching mode should the UPS become active. If the
 power is restored the original caching mode will be restored. Any I/O
 port may be monitored for active signals. The polarity of the signals 
 may be inverted. Multiple signals may be selected using the IoMask
 value. 

command format:
UP:{IoPort}:{IoPolarity}:{IoMask}:{CacheMask}[:{PollSeconds}[:{PollCount}]]

  Items in {} are required, item in [] optional.


IoPort: Input port address (Hex); Hex indicates hexidecimal numeric format

IoPolarity: Inverts sense of input port bits (Hex.)
            0 does not change value, 1 inverts bits sense

IoMask: Determines which bits to test for non-zero condition (Hex.)
       0 drops bit from test, 1 retains IoPort bit value.
       Non-Zero results indicates active UPS (AC power off)
       Zero results indicates inactive UPS (AC power on)
 
CacheMask: is a bit field, 1 disables, 0 no change

Bit.....BitName:  A one (1) will disable the corresponding function

0..StagedFloppy:  Stage Write floppy drive write operations
1....StagedHard:  Stage Write hard drive write operations
2..VerifyFloppy:  Verify floppy drive write operations
3....VerifyHard:  Verify hard drive write operations
4.....Reserved0:  Reserved always 0
5.....Reserved1:  Reserved always 0
6..FloppyEnable:  Enable floppy caching
7..CacheEnabled:  Enable all caching functions


PollSeconds: Sets the period in seconds to sample IoPort value

PollCount: Sets the number of identical IoPort samples before changeing
           the cache state.
 


    ---    ---    ---    ---    ---    ---    ---    ---    ---    ---    ---


IoMask Values for COM port based UPS monitoring system:


Computer Serial Interface Modem Status Register(+6),
COM1 base address 3F8+61=3FE, COM2 base address 2F8+6 =2FE


9-Pin Port  25-Pin Port  Signal Name       IoMask (Hex)  IoPolarity (Hex)

Pin 1       Pin-8    	 Carrier Detect    80		   00

Pin 6       Pin-6    	 Data Set Ready    20		   00

Pin 8       Pin-5    	 Clear To Send     10		   00

Pin 9       Pin-22   	 Ring Indicator    40		   00



    ---    ---    ---    ---    ---    ---    ---    ---    ---    ---    ---


To make your own cable for the American Power Conversion (APC) UPS follow the
pin-out details below:


 APC 9 pin interface			Computer 9 pin interface

 Cable end: Male (Pins)			Cable end: Female (Sockets)


   Pin 2 - AC Power Fault------------------Pin 1 - Modem Data Carrier Detect

   Pin 4 - Signal Ground-------------------Pin 5 - Signal Ground


Example setup:

 Monitor COM2, Modem Status port: Bit 7, Carrier Detect, normal polarity
 If power fails disable Staged Writes on both hard and floppy drives
 30 second sample period, 3 matching samples indicates active/inactive UPS

 corresponding HyperDisk command line:


		hyperdk up:2FE:0:80:3:30:3
