
	Support for the 205 'Odd Mod' accelerator statistics card.
	------- --- --- ---  --- ---  ----------- ---------- ----


     This card has numerous registers which can be read with various
Camac function codes.  It is a somewhat fluid entity, as Todd Johnson
and Brian Hendricks re-do it every major shutdown. 

     The approach is thus to allow some of the Camac addressing to be
built into the SSDN.  This permits Todd and Brian to tinker to their
hearts' content (or rather, to Mau's heart's content), and to create new
devices for the new numbers the card produces. 

     The SSDN is always as follows:

		+-------------------------------+
		|		0		|
		+-------------------------------+
		|	0	| OID = 25 (hex)|
		+-------------------------------+
		|   crate	|   slot	|
		+-------------------------------+
		|  sub-code	|  parameter	|
		+-------------------------------+

     The "sub-code" is a small integer.  The meaning of the "parameter"
is dependent upon the sub-code.

     Since this card is almost entirely a read-only device we shall
discuss readings first.  There are five sub-codes, each of which does
something different.


Sub-Code 1: Single Word Readings
-------- -  ------ ---- --------

     With this sub-code it is possible to perform a simple Camac read
of a single word.

     For this sub-code the parameter contains Camac A (subaddress) and
F (function) codes thusly:

	parameter = 0fffaaaa (binary)

     The front end will read a single word using the Camac command
F(f)A(a).  This is retried once on no-Q.


Sub-Code 2: Two Word F(19)A(0) Style Readings
-------- -  --- ---- --------- ----- --------

     The front end first executes an F(19)A(0).  The data it transmits
is a single word containing a -1.  This is retried once on no-Q.

     The parameter byte for this sub-code is identical to the parameter
byte for sub-code 1:

	parameter = 0fffaaaa (binary)

     After the initial F(19), the front end reads two words with
F(f)A(a) Camac commands.  These are retried once on no-Q. 


Sub-Code 3: Long F(19)A(0) Buffers
-------- -  ---- --------- -------

     For this sub-code the parameter byte is a code recognized by the
205 card.  The front end first executes an F(19)A(0).  The data it
transmits is extracted from the parameter byte.  The F(19)A(0) is
retried once on no-Q. 

     After the initial F(19) the front end reads many words with
F(4)A(0) commands.  How many words does it read?  When you call DPREQ in
the application program you specify a 'length' parameter (in bytes). 
This is the length of the buffer that the front end will read.  The F(4)
is retried 5 times on no-Q. 

     The buffer is limited to no more than 1k bytes long.


Sub-Code 4: F(19)A(2) - F(4)A(1) Buffer
-------- -  ---------   -------- ------

     I'm not sure what special purpose buffer this is, but the front end
will execute an F(19)A(2) (data = 0) and then read exactly 15 words with
F(4)A(1) commands. 

     The parameter byte is ignored.


Sub-Code 5: F(19)A(6) - F(0)A(0) Cycle by Cycle Array
-------- -  ---------   -------- ----- -- ----- -----

     Conceptually the cycle by cycle array is a 256 word long buffer.
Brian wants to read chunks of this buffer starting at any point in the
middle. 

     The front end first executes an F(19)A(6).  The data for this write
tells the 205 card which cycle to start with.  How does the front end
which cycle to start with?  When the application program called DPREQ it
specifies an 'offset' parameter in bytes.  Since each entry in the array
is one word long, you specify the starting cycle number by making the
'offset' equal to twice the cycle number. 

     The F(19)A(6) command is retried once on no-Q.

     The front end then reads many words with F(0)A(0).  Each read is
retried 5 times on no-Q.  The number of words to read is specified by
the 'length' parameter in the DPREQ call, just as it is in sub-code 3. 

     The parameter byte is ignored by this sub-code.


Setting Sub-Code 1: Single Word Settings
------- -------- -  ------ ---- --------

      The Setting property for a device can be used for writing single
words into the 205 card.  The A and F parts of the Camac command are
coded into the SSDN.  The data to write is given directly to DPSET when
the application program runs.

      The SSDN for this option looks the same as the SSDN above.
Remember that the Reading property and the Setting property have their
own private SSDNs in the data base.  Thus you can create a device which
reads one Camac A,F and sets a different Camac A,F, because each property
will have different information coded into its SSDN.

      The parameter word is the same:

	parameter = aaaa/0fff

      When the front end receives the setting it transmits a single word
to the 205 card using the Camac command F(f+16)A(a).  This is retried
once on no-Q.

      Note the funny computation for the Camac F code.  If you want to
write F(19) to the card, you specify a 3 in the parameter byte in the
SSDN.  Camac uses F codes 16 - 23 for writing data, so there is no loss
of generality in this method.
