							12/31/90 (rev)


	         Front End Support for the Pisa Boxes.

			B. Lublinsky / M. Glass



     PISA box is photomultiplier high voltage distribution system and
of three main elements: a high voltage power source, high voltage
distribution and monitor crate and CAMAC interface. Each high voltage
distribution crate houses three boards: a processor board and two
identical motor boards. The processor board controls the individual
DC motors and digitizes the output voltages for readback. 

     Computer control is accomplished through a CAMAC card, which
drives the serial link to the distribution crates. 

     The front end supports READING, SETTING, and ANALOG ALARM
properties.  Reading the SETTING returns the current digitized voltage
(the same as the READING property), and not the desired setpoint.
                                                                      
     The SSDN for all operations looks like:

          +----------------------------------------------+            
          | 78 (hex)             |  FF ( hex)            |            
          +----------------------------------------------+            
          | 'N' slot             |  'C' crate number     |            
          +----------------------------------------------+            
          | device's crate       | subaddress ( 0 - 45 ) |            
          +----------------------------------------------+            
          |                      0                       |            
          +----------------------------------------------+            
                                                                      
     In Dabbel this looks like:

	SSDNHX READNG (77FF/nncc/ddaa/0000)
	SSDNHX SETTNG (77FF/nncc/ddaa/0000)
	SSDNHX ANALBL (77FF/nncc/ddaa/0000)

			cc - Camac crate
			nn - Camac slot
			dd - device's crate
			aa - subaddress  (0-2D)

     Reading and setting data are two bytes long, containing the
unmodified right-adjusted output of the 12 bit ADC.  This ADC is
scaled so that 1 lsb = 0.5 volt, so full scale (0FFF hex) = 2047.5 V.

     Note that channels 0 through 39 are settable, but channels 40
through 45 are not.  Therefore, there should be no database setting
property for channels 40 through 45: the SSDNHX SETTNG, PRO SETTNG,
and PDB SETTNG lines are simply omitted from the DABBEL input.


Annotated Sample DABBEL Input For A SAM Database Device (one channel).
--------- ------ ------ ----- --- - --- -------- ------ ---- --------

     There are, in theory, 74 independent parameters in this database
entry (including the device name and defaulted parameters).  However
most are duplicates of earlier ones, and some are magic numbers which
are too complicated to explain here. 

     For CDF Pisa boxes, the independent parameters which you should
change from this example (along with their values used in this
example) are: 

		Device name:	Z:PB0100
		Device description.
		Camac crate:	14 (dec)  0E (hex)
		Camac slot:	15 (dec)  0F (hex)
		Pisa crate:	 1 (dec)  01 (hex)
		Channel:	45 (dec)  2D (hex)
	
     We have also specified alarm low and high limits as their
minimum and maximum values.  It is possible to enter real values
here, but it is customary (an usually easier) to enter them from
parameter pages later. 

     (One slight deviation: channel 45 used in this example usually
does NOT have a setting property).


ADD Z:PB0100 ('TST PISA BOX CR-01 CH-45', CDFFE)
        |           |                      |    |
        |           |                      |    +-- Missing fields defaulted
        |           |                      +-- Front end token ring node
        |           +-- Up to 24 character description
        +-- Unique name (much too short, of course).

EMX (0532/0F0E/012D/0)
       |   |    |
       |   |    +-- HV crate (left byte) and channel (right byte)
       |   +-- Camac slot (left byte) and Camac crate (right byte)
       +-- Magic EMX numbers (=category 5 alarm from front end node 50)

SSDNHX READNG (78FF/0F0E/012D/0)
                 |   |    |
                 |   |    +-- HV crate (left byte) and channel (right byte)
                 |   +-- Camac slot (left byte) and Camac crate (right byte)
                 +-- Special SSDN Camac module identifier (78FF = Pisa box)

PRO READNG (2, 2, 600)
            |  |   |
            |  |   +-- 10 second default display update rate
            |  +-- Maximum size of datum = 2 bytes
            +-- Default size of datum = 2 bytes

PDB READNG ('CNTS', 'VOLT', 10, 6, 2, 0, 0, 0, 1.0, 2.0)
              |       |     |   |  |            |    |
              |       |     |   |  |            |    +-- C2
              |       |     |   |  |            +-- C1
              |       |     |   |  +-- Size of datum to convert = 2 bytes
              |       |     |   +-- Common transform: f(x) = C1*x / C2
              |       |     +-- Primary transform: f(x) = float(x)
              |       +-- Physical (engineering) units (after both transforms)
              +-- Primary units (after only primary transform has applied)

SSDNHX SETTNG (78FF/0F0E/012D/0)
  |
  +-- Duplicate of SSDNHX READNG

PRO SETTNG (2, 2, 600, 0)
  |                    |
  |                    +-- Force the datbase to remember your last set value
  +-- Almost duplicate of PRO READNG

PDB SETTNG ('CNTS', 'VOLT', 10, 6, 2, 0, 0, 0, 1.0, 2.0)
  |
  +-- Duplicate of PDB READNG: function will be inverted automatically

SSDNHX ANALBL(78FF/0F0E/012D/0)
  |
  +-- Duplicate of SSDNHX READNG (used for analog alarms)

PRO ANALBL (2, 20, 600, 0, FFF, 2, 2, 1, 1, 0, 0, 0, 1, 0, 0, 0)
      |                 |   |      |                 |
      |                 |   |      |                 +-- 1=Alarm enabled
      |                 |   |      +-- 2 byte datum
      |                 |   +-- High limit (adjustable later from console)
      |                 +-- Low limit (also adjustable)
      +-- Analog alarm parameters.  A lot of magic numbers here.
   
PRO ANALTX (5, '!HL')
      |     |    |
      |     |    +-- Display device name and "high" or "low"
      |     +-- Display priority (if the display is full) (5 = lowish)
      +-- Alarm display parameters (standard Accelerator alarm display screen)
