							19 Mar 90 (rev)


	     Support for the 185 digital input card.


     The 185 card has two words of digital input.  It also has two
pulsed output bits.  The two digital input words can be read through
multiple devices, each of which reads a single word or some fraction
of a word.  You can also read the whole two words from one device.


SSDN
----

     The front end recognizes four data base properties: Reading, Basic
Status, Basic Control, and Digital Alarm.  Analog Alarm can be added
later if it is needed.  All properties have the same SSDN: 


		+---------------------------------+
		|               mask              |
		+---------------------------------+
		|        0       | OID = 46 (hex) |
		+---------------------------------+
		|    crate       |     slot       |
		+---------------------------------+
		|    46 (hex)    |   flag bits    |
		+---------------------------------+


     The subaddress is 0 or 1, to select which word of digital input
to read.  [Editor's note:  the subaddress is no longer in the SSDN]

     Flag bits are defined as follows.  We describe them further below.

	Bit 2**0    1 = right shift data until it is right-adjusted
			before returning it to the console.
	Bit 2**1    1 = increment data before returning it.
	Bit 2**2    1 = console needs 'software decoder' (1 bit out
			of many)
	Bit 2**3    1 = hardware device needs 'software decoder'.
	Bit 2**4    (used by 184 driver only)
	Bit 2**5    1 = signed data (for shifted operations).


READING DATA (ONE WORD OR LESS)
------- ----  --- ---- -- ----

     You can read data with either the Basic Status or Reading
properties.  Both are treated identically.

     The length of the device data must be exactly one word.  The sub-
address field in the SSDN selects which word.

     By masking (and possibly shifting) it is possible to read a
fraction of a word.  The mask is always applied.  If you want to read
the whole word you specify a mask of FFFF, if you want to read only the
upper nibble you specify a mask of F000, and so on.  Of course it is
possible to specify several data base devices, each of which reads
some fraction of the same input register.

     Read operations work as follows.  The front end reads the digital
input word from the 185 card (with an F(0)A(N) command).  This word
is 'anded' with the mask.  It is then optionally right-shifted if the
'shift' bit is on.


     The masking, shifting, and mashing work the same as they do for
the 184 card.

     Some examples are:

        Mask   Shift flag

        FFFF       0        Just return the whole word unchanged
        FF00       0        Take the high order byte if the reading
                              and return it in the TOP of the result
                              word, with zeroes in the low order
                              byte.
        FF00       1        Take the high order byte of the reading
                              and return it in the BOTTOM of the
	                      result, as a number from 0 to 255.
        0008       0        Return only bit 2**3 as a '0' or an '8'.
                              The other bits are zeroed.
        0008       1        Return only bit 2**3, right adjusted,
                              as a '0' or a '1'.
        000C       1        Return only bits 2**2 and 2**3, right
                              adjusted, as a number from 0 to 3.


     After the above operations are performed the result can be
optionally mashed by the other flags. 

     The 'increment' flag merely adds 1 to the result.  As an example:
if the mask is 1F, and the increment bit is on, the console will receive
a number between 1 and 32

     The 'software decoder' bits simulate the a 'one bit out of many'
function.  The two bits define which side of the world, the console or
the 184 card, is expecting the 'one bit out of many' form and which is
expecting to see a simple binary number.  The low order bit is taken to
be bit 0. 

     If the masked and shifted reading is a number from 0-3, and the
'console needs software decoder' bit is on, then the console will
receive the values (in binary) 0001, 0010, 0100, 1000.  The 'hardware
needs software decoder' bit works in reverse: the status register is in
one bit out of many form, but the console receives a small integer. 


READING DATA (TWO WORDS IN A SINGLE READ)
------- ----  --- ----- -- - ------ ----

     You use the Basic Status or Reading properties.  Both are treated
identically by the front end.

     You must specify that your data is exactly 2 words long.  This is
how the front end knows that you are doing a 2 word reading.

     There is NO masking, shifting, or other mashing of the two words
of data.  You get it straight and unadulturated.  The mask and flag
bits in the SSDN are ignored.

     However you get a choice of WHICH WORD YOU WANT FIRST.  If the
subaddress in the SSDN is 0, then you get word 0 followed by word 1.  If
the subaddres is 1, then you get word 1 first followed by word 0.



CONTROL OF THE PULSED LINES
------- -- --- ------ -----

     You write a single word of Basic Control.  The low order bit
specifies which bit to pulse: 0=P0, 1=P1.
