SINTRAN III/CAMAC communication

From NDWiki
Revision as of 22:26, 17 July 2012 by Tingo (talk | contribs) (→‎Monitor Calls: updated text for MON 150)
Jump to navigation Jump to search

The CAMAC system is a general purpose modular electronic instrumentation, standard for data handling, intended for applications requiring numerous and fast transfers of information (data, control) between various instruments and the computer. A CAMAC system contains one or more crates (CAMAC chassis) and each crate is separated into 24 stations where various kinds of CAMAC modules may be placed. For further documentation, refer to the CAMAC-CC/Nord-10 Manual (ND.12.007).

SINTRAN III is able to handle 16 crates. Each crate may handle 16 graded LAM interrupts (1 - 16), plus one RT interrupt on level 13 which is identified and assigned as LAM number 0.

By means of the monitor call (CONCT), different RT programs may be connected to different LAM interrupts on levels 10, 11, 12 and 13.

Monitor Calls

The following seven monitor calls are implemented in SINTRAN III in connection with CAMAC (MON 146 - 154).

MON 146                   INIT
                          CALL INIT (<flag>, <crate no>, <level>)
                          Initialize a crate for the appropriate level, ie. clears data away and masks and writes COST
                          (enables RT, ERROR and L for actual level).
                          Return: <flag> = 0, OK
                                  <flag> = 24, NOT OK
MON 147                   CAMAC
                          CALL CAMAC (<value>, <flag>, <crate no>, <station>, <sub address>, <function>)
                          Operates the CAMAC (executes NAF). If <function> is clear, the contents of COST are returned in <value>.
                          If <function> is read, data is returned in <value>.
                          For clear and read functions, <flag> must be >= 0 on entry.
                          If function is write, data must be in <value> and <flag> must be > 0 before the call.
                          Return: <flag> = 0, OK
                                  <flag> = 24, NOT OK
                          If bit 15 in <crate no> is set equal to one, <value> is treaded as integer instead of floating.
MON 150                   GL
                          CALL GL (<value>, <flag>, <crate no>)
                          Reads graded LAM status. The status is returned in <value>.
                          If <crate no> = 1 on the entry, the last IDENT code is returned as an integer in <value>.
                          Return: <flag> = 0, OK
                                  <flag> = 24, NOT OK
MON 151                   LMASK
                          CALL LMASK (<value>, <flag>, <crate no>)
                          Reads and writes MASK.
                          If <flag> >= 0, the mask is read and returned in <value>.
                          If <flag> < 0, the contents of <value> are written to the mask.
                          Return: <flag> = 0, OK
                                  <flag> = 24, NOT OK
MON 152                   CONTR
                          CALL CONTR(<value>, <flag>, <crate no>)
                          Reads and writes COST (control / status register).
                          If <flag> >= 0, the COST is read and returned in <value>.
                          If <flag> < 0, the contents of <value> are written to COST.
                          Return: <flag> = 0, OK
                                  <flag> = 24, NOT OK
MON 153                   IOXN
A = data if write         Executes a signle IOX instruction
D = IOX code (2000 octal < D < 4000 octal)
Return:
A = data if read
MON 154                   ASSIG
T = graded LAM            Assigns a graded LAM in the CAMAC ident table to a logical number in the logical number table
A = logical unit no.
  (A = 0 is used for high
   priority on level 13)
D = crate no.
Return:
A = -1 means wrong parameter

The calls CAMAC, GL, LMASK and CONTR handle their <value> parameter as an integer if bit 15 in the <crate no> parameter is set, otherwise, <value> is treated as a real number.

Note: for use with MAC, standard FORTRAN parameter communication is applied.

CAMAC Library

The following routines are available in the CAMAC BRF Library:

CALL INIT  (<ILEV>, <IC>)
           Initializes a crate for interrupts from an appropriate level, i.e, clears DATAWAY and masks and enables RT, ERROR and L for the actual level.
           <ILEV> = actual level (must be 10, 11 or 12)
           <IC> = crate number
CALL CAMAC (<IDATA>, <ISTAT>, <IC>, <IN>, <IA>, <IF>)
           Executes a single NAF.
           <IDATA> = data to be written from or read into
           <ISTAT> = the interface status is returned here
           <IC> = crate number
           <IN> = station number
           <IA> = subaddress
           <IF> = function
CALL GL    (<IVAL>, <IC>)
           Reads the GL register or the last ident from the CAMAC
           <IVAL> = return information is placed here
           <IC> = if -1 read last ident; if <> -1 red GL register and <IC> = crate number
CALL LMASK (<IVAL>, <IDIR>, <IC>)
           Reads or writes the mask register
           <IVAL> = the value to be read from or written into the mask register
           <IDIR> = 0 means read from the mask register; < 0 means write to the mask register
           <IC> = crate number
CALL CONTR (<IVAL>, <IDIR>, <IC>)
           Does the same thing as the LMASK call with the COST register
           <IC> = crate number
CALL IOXN  (<ID>, <IC>)
           Executes a single IOX instruction
           <ID> = data
           <IC> = IOC code (2000 octal < IC < 4000 octal)
CALL ASSIG (<ILN>, <IGL>, <IC>)
           Assigns a graded LAM in the CAMAC ident table to a logical number in the logical number table.
           Note that LAM = 0 is used for high priority interrupts on level 13
           <ILN> = logical unit number
           <IGL> = graded LAM number
           <IC> = crate number

References

Norsk Data Document ND–060.050.06 SINTRAN III USERS GUIDE , section 9.5