intro_c465


			Overview of Camac 465 Cards

	This note is intended to introduce the programmer and expert user to
	the structure and function of the C465 cards.  There are four
	variations of these cards.  These differences will not be discussed
	in this document.  More details on the cards can be found in
	Controls Hardware Release #75
	(http://www-bd.fnal.gov/controls/camac_modules/c465.htm) and
	the front end support documentation
	(/usr/local/userb/nfe/doc/devs/465.lis).

	The C465 is a programmable ramp controller that generates an analog
	waveform.  The waveform is a function of time and current.  The
	general equation for the output of the card is:

   	Vout = sf1 * m1 * F(t)  +  sf2 * m2 * G(i)  +  c3 * m3 * H(i)

   	(The terms are commonly called "f-of-t", "g-of-i" and "h-of-i".)

	The components of the terms are:

   	sf1, sf2, sf3		scale factor constants
   	m1, m2, m3		MDAT (Machine DATa) multipliers
   	F(t), G(i), H(i)	64 independent-dependent values
				(called "slots")
	
	All of these selections are downloaded to the card by console
	application programs.  The card does a linear interpolation from one
	table slot to the next.  The time portion is updated at either
	1, 5 or 10 kHz rate.  The TEVATRON cards commonly use 1 kHz.  The
	MDAT portion is updated at 720 Hz rate.

	The tables addressed by the card are:

   	table name		# tables (possible)	# slots/table
	----------		-------------------	-------------
   	time			15			64
   	G-MDAT (dependent)	15			64
   	H-MDAT (dependent)	15			64
   	scale factor		1			15
   	clock			1			128
   	ramp pointer		1			32
   	scale factor pointer	1			96
   	MDAT pointer		1			96
   	G-MDAT (independent)	1			64
   	H-MDAT (independent)	1			64
	
   	Note:  The number of available tables is set by the
	       database entry.

	Notice there's one independent value table and 16 dependent value
	tables for G and H values.  The time table is holds both independent
	and dependent values in each slot.

	Upon decoding a clock event the card searches the clock table for the
	event received.  Each of the 16 possible output functions can have 8
	possible clock events to trigger it.  The 8 possible events are ORed
	together to decide which pointer tables to look at.  When the i-th
	function is triggered the i-th ramp pointer, scale factor pointer
	and MDAT pointer levels are addressed.  In the ramp pointer table
	the second nibble contains the time table number.  The third nibble
	contains the G-MDAT table number, and the fourth nibble contains the
	H-MDAT table number.  The scale factor pointer and MDAT pointer tables
	both address the desired slot numbers in order of time, G-MDAT,
	H-MDAT.  There are 32 values of each, each being 1 word.

	The time table plays out as follows.  Each slot has a independent
	value that specifies how long to take, in clock ticks, to go from the
	present value to the dependent value of the slot.

	The MDAT tables play out as follows.  The card does a real-time
	interpolation to find the indpendent value (i.e. the current) and then
	interpolates to get the proper dependent value.

	The programmer can use td_xxx routines (CLIB) to access and set table
	devices.  There, addressing is specified by table number and slot
	numbers.  The programmer can use defined constants in the 'diolib'
	include files to specify the table types.
	
	See CLIB subtopic intro_td for more information.

	Related functions:

	intro_td, td_build, td_cancel, td_read, td_read_one(_c), td_set,
	td_set_one(_c), td_query