						29 April 1989
						M. Glass



	     372 DIGITAL FUNCTION GENERATOR SUPPORT



     The 372 card can be configured in two ways: it runs either
a single function F0 with 32 bit values or two simultaneous
functions F1 and F2 with 16 bit values.  The choice is set by
dip switches.  Therefore the database entries are also fixed:
you can use a single database entry for the F0 function or two
different database entries for the F1 and F2 functions.  A code
in the SSDN identifies a device as representing the F0, F1, or
F2 functions. 

     The front end supports reading and writing the function
tables through the Setting property.  It also supports Basic
Status and Control properties.  If you want a Reading property
it must address different different hardware (such as an MADC
channel).  There are no alarms at this time.

     The SSDN for the Setting, Basic Status, and Basic Control
properties looks as follows:

		+-------------------------------+
		|	       0		|
		+-------------------------------+
		|       0      | OID = 67 (hex)	|
		+-------------------------------+
		|     crate    |     slot 	|
		+-------------------------------+
		|       0      |      code      |
		+-------------------------------+

     Where the code describes this device's function table:

		0 = F0 function
		1 = F1
		2 = F2


SETTING PROPERTY
------- --------

     The setting property contains the function table.  Since
these tables are quite large (F0 = 256kb, F1 and F2 = 128kb), it
is not possible to use the "maximum length" parameter in the data
base.  It is also not possible to read and write arbitrary slices
out of the function tables, since the "length" and "offset"
parameters in the DPREQ calls will overflow.  We are going to have
to resort to a bit of trickery.

     We divide the function tables up into chunks of 256 bytes. 
We can theoretically read or write a slice of table starting
only at a chunk boundary, i.e. a byte address which is an exact
multiple of 1/4k. 

     The "offset" parameter in the DPREQ call specifies the
function table byte address in units of 256 bytes, so that an
"offset" of 0 refers to byte addres 0, an offset of 4 refers to
byte address 1k, and so on.  The maximum "offset" is 1023 for an
F0 device and 511 for the F1 and F2 devices. 

     Unfortunately, DPM checks that your "offset" is a multiple
of the default length.  The default length probably ought to be
the size of one table entry: 4 bytes for F0 and 2 bytes for F1
and F2.  Thus as a practical matter you can specify "offsets"
which are only multiples of 2 or 4, i.e. address which are exact
multiples of 1k (F0) or 1/2k (F1,F2).

     The achievable chunk addresses for reading and writing
function tables are multiples of 1k for F0 and 1/2k for F1 and
F2.  Of course you can read/write any length you want in a
single transfer, several chunks or a partial chunk, as specified
by the length (in bytes) parameter to DPREQ. The front end
limits the maximum length of a single transfer to 2k bytes. 

     The "maximum length" parameter in the database is the
maximum transfer size plus the highest "offset" code.  You can
derive these numbers by thinking about the DPREQ call to read
the last piece of the table, assuming you are reading the most
bytes you can at once.  The data base entries must therefore
contain: 

	PRO SETTNG (4, 3071, 60)	! F0       2048 + 1023
	PRO SETTNG (2, 2559, 60)	! F1, F2   2048 + 511


BASIC STATUS PROPERTY
----- ------ --------

     The basic status property is only one word long in the
database.  It returns the result of the appropriate F(1)A(x)
status reading, where "x" specifies F0, F1, or F2.  The
basic status SSDN must contain the code for the appropriate
function.


BASIC CONTROL PROPERTY
----- ------- --------

     The basic control property is only one word long.  You send
down a basic control code as follows:

	1  OFF    F(24)A(x)   "x" = 0, 1, or 2 from the SSDN
	2  ON     F(26)A(x)   "x" same
	3  RESET  F(9)A(0)

     If the database device is for an F1 or F2 function, and you
want the "on" and "off" commands to control BOTH functions
simultaneously, then you should set the code in the Basic Control
SSDN to 0 (as if this were an F0 device).  This is a hardware
feature.  The Setting and Basic Status SSDNs will still carry the
genuine code.
