Camac Functions (camxxx)
[Midas CAMAC standard]


Functions

EXTERNAL INLINE void EXPRT cam16i (const int c, const int n, const int a, const int f, WORD *d)
EXTERNAL INLINE void EXPRT cam24i (const int c, const int n, const int a, const int f, DWORD *d)
EXTERNAL INLINE void EXPRT cam8i_q (const int c, const int n, const int a, const int f, BYTE *d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam16i_q (const int c, const int n, const int a, const int f, WORD *d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam24i_q (const int c, const int n, const int a, const int f, DWORD *d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam16i_r (const int c, const int n, const int a, const int f, WORD **d, const int r)
EXTERNAL INLINE void EXPRT cam24i_r (const int c, const int n, const int a, const int f, DWORD **d, const int r)
EXTERNAL INLINE void EXPRT cam8i_rq (const int c, const int n, const int a, const int f, BYTE **d, const int r)
EXTERNAL INLINE void EXPRT cam16i_rq (const int c, const int n, const int a, const int f, WORD **d, const int r)
EXTERNAL INLINE void EXPRT cam24i_rq (const int c, const int n, const int a, const int f, DWORD **d, const int r)
EXTERNAL INLINE void EXPRT cam8i_sa (const int c, const int n, const int a, const int f, BYTE **d, const int r)
EXTERNAL INLINE void EXPRT cam16i_sa (const int c, const int n, const int a, const int f, WORD **d, const int r)
EXTERNAL INLINE void EXPRT cam24i_sa (const int c, const int n, const int a, const int f, DWORD **d, const int r)
EXTERNAL INLINE void EXPRT cam8i_sn (const int c, const int n, const int a, const int f, BYTE **d, const int r)
EXTERNAL INLINE void EXPRT cam16i_sn (const int c, const int n, const int a, const int f, WORD **d, const int r)
EXTERNAL INLINE void EXPRT cam24i_sn (const int c, const int n, const int a, const int f, DWORD **d, const int r)
EXTERNAL INLINE void EXPRT cami (const int c, const int n, const int a, const int f, WORD *d)
EXTERNAL INLINE void EXPRT cam8o (const int c, const int n, const int a, const int f, BYTE d)
EXTERNAL INLINE void EXPRT cam16o (const int c, const int n, const int a, const int f, WORD d)
EXTERNAL INLINE void EXPRT cam24o (const int c, const int n, const int a, const int f, DWORD d)
EXTERNAL INLINE void EXPRT cam8o_q (const int c, const int n, const int a, const int f, BYTE d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam16o_q (const int c, const int n, const int a, const int f, WORD d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam24o_q (const int c, const int n, const int a, const int f, DWORD d, int *x, int *q)
EXTERNAL INLINE void EXPRT cam8o_r (const int c, const int n, const int a, const int f, BYTE *d, const int r)
EXTERNAL INLINE void EXPRT cam16o_r (const int c, const int n, const int a, const int f, WORD *d, const int r)
EXTERNAL INLINE void EXPRT cam24o_r (const int c, const int n, const int a, const int f, DWORD *d, const int r)
EXTERNAL INLINE void EXPRT camo (const int c, const int n, const int a, const int f, WORD d)
EXTERNAL INLINE int EXPRT camc_chk (const int c)
EXTERNAL INLINE void EXPRT camc (const int c, const int n, const int a, const int f)
EXTERNAL INLINE void EXPRT camc_q (const int c, const int n, const int a, const int f, int *q)
EXTERNAL INLINE void EXPRT camc_sa (const int c, const int n, const int a, const int f, const int r)
EXTERNAL INLINE void EXPRT camc_sn (const int c, const int n, const int a, const int f, const int r)
EXTERNAL INLINE int EXPRT cam_init (void)
EXTERNAL INLINE int EXPRT cam_init_rpc (char *host_name, char *exp_name, char *fe_name, char *client_name, char *rpc_server)
EXTERNAL INLINE void EXPRT cam_exit (void)
EXTERNAL INLINE void EXPRT cam_inhibit_set (const int c)
EXTERNAL INLINE void EXPRT cam_inhibit_clear (const int c)
EXTERNAL INLINE int EXPRT cam_inhibit_test (const int c)
EXTERNAL INLINE void EXPRT cam_crate_clear (const int c)
EXTERNAL INLINE void EXPRT cam_crate_zinit (const int c)
EXTERNAL INLINE void EXPRT cam_lam_enable (const int c, const int n)
EXTERNAL INLINE void EXPRT cam_lam_disable (const int c, const int n)
EXTERNAL void cam_lam_read (const int c, DWORD *lam)
EXTERNAL INLINE void EXPRT cam_lam_clear (const int c, const int n)
EXTERNAL INLINE int EXPRT cam_lam_wait (int *c, DWORD *n, const int millisec)
EXTERNAL INLINE void EXPRT cam_interrupt_enable (const int c)
EXTERNAL INLINE void EXPRT cam_interrupt_disable (const int c)
EXTERNAL INLINE int EXPRT cam_interrupt_test (const int c)
EXTERNAL INLINE void EXPRT cam_interrupt_attach (const int c, const int n, void(*isr)(void))
EXTERNAL INLINE void EXPRT cam_interrupt_detach (const int c, const int n)


Function Documentation

EXTERNAL INLINE void EXPRT cam16i const int  c,
const int  n,
const int  a,
const int  f,
WORD *  d
 

16 bits input.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
Returns:
void

EXTERNAL INLINE void EXPRT cam16i_q const int  c,
const int  n,
const int  a,
const int  f,
WORD *  d,
int *  x,
int *  q
 

16 bits input with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
x X response (0:failed,1:success)
q Q resonpse (0:no Q, 1: Q)
Returns:
void

Referenced by csmad(), and cssa().

EXTERNAL INLINE void EXPRT cam16i_r const int  c,
const int  n,
const int  a,
const int  f,
WORD **  d,
const int  r
 

Repeat 16 bits input.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
r repeat time
Returns:
void

EXTERNAL INLINE void EXPRT cam16i_rq const int  c,
const int  n,
const int  a,
const int  f,
WORD **  d,
const int  r
 

Repeat 16 bits input with Q stop.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r repeat time
Returns:
void

EXTERNAL INLINE void EXPRT cam16i_sa const int  c,
const int  n,
const int  a,
const int  f,
WORD **  d,
const int  r
 

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

WORD pbkdat[4];
cam16i_sa(crate, 5, 0, 2, &pbkdat, 4);
equivalent to :
cam16i(crate, 5, 0, 2, &pbkdat[0]);
cam16i(crate, 5, 1, 2, &pbkdat[1]);
cam16i(crate, 5, 2, 2, &pbkdat[2]);
cam16i(crate, 5, 3, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive sub-address to read
Returns:
void

EXTERNAL INLINE void EXPRT cam16i_sn const int  c,
const int  n,
const int  a,
const int  f,
WORD **  d,
const int  r
 

Read the given CAMAC address and increment the station number by one. Repeat r times.

WORD pbkdat[4];
cam16i_sa(crate, 5, 0, 2, &pbkdat, 4);
equivalent to :
cam16i(crate, 5, 0, 2, &pbkdat[0]);
cam16i(crate, 6, 0, 2, &pbkdat[1]);
cam16i(crate, 7, 0, 2, &pbkdat[2]);
cam16i(crate, 8, 0, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive station to read
Returns:
void

EXTERNAL INLINE void EXPRT cam16o const int  c,
const int  n,
const int  a,
const int  f,
WORD  d
 

Write data to given CAMAC address.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
Returns:
void

EXTERNAL INLINE void EXPRT cam16o_q const int  c,
const int  n,
const int  a,
const int  f,
WORD  d,
int *  x,
int *  q
 

Write data to given CAMAC address with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
x X response (0:failed,1:success)
q Q resonpse (0:no Q, 1: Q)
Returns:
void

Referenced by cssa().

EXTERNAL INLINE void EXPRT cam16o_r const int  c,
const int  n,
const int  a,
const int  f,
WORD *  d,
const int  r
 

Repeat write data to given CAMAC address r times.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
r number of repeatition
Returns:
void

EXTERNAL INLINE void EXPRT cam24i const int  c,
const int  n,
const int  a,
const int  f,
DWORD *  d
 

24 bits input.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
Returns:
void

Referenced by read_scaler_event().

EXTERNAL INLINE void EXPRT cam24i_q const int  c,
const int  n,
const int  a,
const int  f,
DWORD *  d,
int *  x,
int *  q
 

24 bits input with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
x X response (0:failed,1:success)
q Q resonpse (0:no Q, 1: Q)
Returns:
void

Referenced by cfmad(), and cfsa().

EXTERNAL INLINE void EXPRT cam24i_r const int  c,
const int  n,
const int  a,
const int  f,
DWORD **  d,
const int  r
 

Repeat 24 bits input.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out
r repeat time
Returns:
void

EXTERNAL INLINE void EXPRT cam24i_rq const int  c,
const int  n,
const int  a,
const int  f,
DWORD **  d,
const int  r
 

Repeat 24 bits input with Q stop.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r repeat time
Returns:
void

EXTERNAL INLINE void EXPRT cam24i_sa const int  c,
const int  n,
const int  a,
const int  f,
DWORD **  d,
const int  r
 

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

DWORD pbkdat[8];
cam24i_sa(crate, 5, 0, 2, &pbkdat, 8);
equivalent to
cam24i(crate, 5, 0, 2, &pbkdat[0]);
cam24i(crate, 6, 0, 2, &pbkdat[1]);
cam24i(crate, 7, 0, 2, &pbkdat[2]);
cam24i(crate, 8, 0, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive sub-address to read
Returns:
void

EXTERNAL INLINE void EXPRT cam24i_sn const int  c,
const int  n,
const int  a,
const int  f,
DWORD **  d,
const int  r
 

Read the given CAMAC address and increment the station number by one. Repeat r times.

DWORD pbkdat[4];
cam24i_sa(crate, 5, 0, 2, &pbkdat, 4);
equivalent to :
cam24i(crate, 5, 0, 2, &pbkdat[0]);
cam24i(crate, 6, 0, 2, &pbkdat[1]);
cam24i(crate, 7, 0, 2, &pbkdat[2]);
cam24i(crate, 8, 0, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive station to read
Returns:
void

EXTERNAL INLINE void EXPRT cam24o const int  c,
const int  n,
const int  a,
const int  f,
DWORD  d
 

Write data to given CAMAC address.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
Returns:
void

EXTERNAL INLINE void EXPRT cam24o_q const int  c,
const int  n,
const int  a,
const int  f,
DWORD  d,
int *  x,
int *  q
 

Write data to given CAMAC address with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
x X response (0:failed,1:success)
q Q response (0:no Q, 1: Q)
Returns:
void

Referenced by cfsa().

EXTERNAL INLINE void EXPRT cam24o_r const int  c,
const int  n,
const int  a,
const int  f,
DWORD *  d,
const int  r
 

Repeat write data to given CAMAC address r times.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
r number of repeatition
Returns:
void

EXTERNAL INLINE void EXPRT cam8i_q const int  c,
const int  n,
const int  a,
const int  f,
BYTE *  d,
int *  x,
int *  q
 

8 bits input with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d data read out data
x X response (0:failed,1:success)
q Q resonpse (0:no Q, 1: Q)
Returns:
void

EXTERNAL INLINE void EXPRT cam8i_rq const int  c,
const int  n,
const int  a,
const int  f,
BYTE **  d,
const int  r
 

Repeat 8 bits input with Q stop.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r repeat time
Returns:
void

EXTERNAL INLINE void EXPRT cam8i_sa const int  c,
const int  n,
const int  a,
const int  f,
BYTE **  d,
const int  r
 

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

BYTE pbkdat[4];
cam8i_sa(crate, 5, 0, 2, &pbkdat, 4);
equivalent to :
cam8i(crate, 5, 0, 2, &pbkdat[0]);
cam8i(crate, 5, 1, 2, &pbkdat[1]);
cam8i(crate, 5, 2, 2, &pbkdat[2]);
cam8i(crate, 5, 3, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive sub-address to read
Returns:
void

EXTERNAL INLINE void EXPRT cam8i_sn const int  c,
const int  n,
const int  a,
const int  f,
BYTE **  d,
const int  r
 

Read the given CAMAC address and increment the station number by one. Repeat r times.

BYTE pbkdat[4];
cam8i_sa(crate, 5, 0, 2, &pbkdat, 4);
equivalent to :
cam8i(crate, 5, 0, 2, &pbkdat[0]);
cam8i(crate, 6, 0, 2, &pbkdat[1]);
cam8i(crate, 7, 0, 2, &pbkdat[2]);
cam8i(crate, 8, 0, 2, &pbkdat[3]);
Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (0..7)
d pointer to data read out
r number of consecutive station to read
Returns:
void

EXTERNAL INLINE void EXPRT cam8o const int  c,
const int  n,
const int  a,
const int  f,
BYTE  d
 

Write data to given CAMAC address.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
Returns:
void

EXTERNAL INLINE void EXPRT cam8o_q const int  c,
const int  n,
const int  a,
const int  f,
BYTE  d,
int *  x,
int *  q
 

Write data to given CAMAC address with Q response.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
x X response (0:failed,1:success)
q Q resonpse (0:no Q, 1: Q)
Returns:
void

EXTERNAL INLINE void EXPRT cam8o_r const int  c,
const int  n,
const int  a,
const int  f,
BYTE *  d,
const int  r
 

Repeat write data to given CAMAC address r times.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (16..31)
d data to be written to CAMAC
r number of repeatition
Returns:
void

EXTERNAL INLINE void EXPRT cam_crate_clear const int  c  ) 
 

Issue CLEAR to crate.

Parameters:
c crate number (0..)
Returns:
void

Referenced by cccc(), and frontend_init().

EXTERNAL INLINE void EXPRT cam_crate_zinit const int  c  ) 
 

Issue Z to crate.

Parameters:
c crate number (0..)
Returns:
void

Referenced by cccz(), and frontend_init().

EXTERNAL INLINE void EXPRT cam_exit void   ) 
 

Close CAMAC accesss.

EXTERNAL INLINE void EXPRT cam_inhibit_clear const int  c  ) 
 

Clear Crate inhibit.

Parameters:
c crate number (0..)
Returns:
void

Referenced by ccci().

EXTERNAL INLINE void EXPRT cam_inhibit_set const int  c  ) 
 

Set Crate inhibit.

Parameters:
c crate number (0..)
Returns:
void

Referenced by ccci().

EXTERNAL INLINE int EXPRT cam_inhibit_test const int  c  ) 
 

Test Crate Inhibit.

Parameters:
c crate number (0..)
Returns:
1 for set, 0 for cleared

Referenced by ctci().

EXTERNAL INLINE int EXPRT cam_init void   ) 
 

Initialize CAMAC access.

Returns:
1: success

Referenced by ccinit(), fccinit(), and frontend_init().

EXTERNAL INLINE int EXPRT cam_init_rpc char *  host_name,
char *  exp_name,
char *  fe_name,
char *  client_name,
char *  rpc_server
 

Initialize CAMAC access for rpc calls

For internal use only.

Parameters:
host_name Midas host to contact
exp_name Midas experiment to contact
fe_name frontend application name to contact
client_name RPC host name
rpc_server RPC server name
Returns:
1: success

EXTERNAL INLINE void EXPRT cam_interrupt_attach const int  c,
const int  n,
void(*)(void)  isr
 

Attach service routine to LAM of specific crate and station.

Parameters:
c crate number (0..)
n station number
(*isr) Function pointer to attach to the LAM
Returns:
void

Referenced by cclnk().

EXTERNAL INLINE void EXPRT cam_interrupt_detach const int  c,
const int  n
 

Detach service routine from LAM.

Parameters:
c crate number (0..)
n station number
Returns:
void

Referenced by cculk().

EXTERNAL INLINE void EXPRT cam_interrupt_disable const int  c  ) 
 

Disables interrupts in specific crate

Parameters:
c crate number (0..)
Returns:
void

Referenced by cccd().

EXTERNAL INLINE void EXPRT cam_interrupt_enable const int  c  ) 
 

Enable interrupts in specific crate

Parameters:
c crate number (0..)
Returns:
void

Referenced by cccd(), and ccrgl().

EXTERNAL INLINE int EXPRT cam_interrupt_test const int  c  ) 
 

Test Crate Interrupt.

Parameters:
c crate number (0..)
Returns:
1 for set, 0 for cleared

Referenced by ctcd().

EXTERNAL INLINE void EXPRT cam_lam_clear const int  c,
const int  n
 

Clear the LAM register of the crate controller. It doesn't clear the LAM of the particular station.

Parameters:
c crate number (0..)
n LAM station
Returns:
void

Referenced by cclnk(), ccrgl(), and read_trigger_event().

EXTERNAL INLINE void EXPRT cam_lam_disable const int  c,
const int  n
 

Disable LAM generation for given station to the Crate controller. It doesn't disable the LAM of the actual station itself.

Parameters:
c crate number (0..)
n LAM station
Returns:
void

EXTERNAL INLINE void EXPRT cam_lam_enable const int  c,
const int  n
 

Enable LAM generation for given station to the Crate controller. It doesn't enable the LAM of the actual station itself.

Parameters:
c crate number (0..)
n LAM station
Returns:
void

Referenced by cclnk(), ccrgl(), and frontend_init().

EXTERNAL void cam_lam_read const int  c,
DWORD *  lam
 

Reads in lam the lam pattern of the entire crate.

Parameters:
c crate number (0..)
lam LAM pattern of the crate
Returns:
void

Referenced by ctgl(), and poll_event().

EXTERNAL INLINE int EXPRT cam_lam_wait int *  c,
DWORD *  n,
const int  millisec
 

Wait for a LAM to occur with a certain timeout. Return crate and station if LAM occurs.

Parameters:
c crate number (0..)
n LAM station
millisec If there is no LAM after this timeout, the routine returns
Returns:
1 if LAM occured, 0 else

EXTERNAL INLINE void EXPRT camc const int  c,
const int  n,
const int  a,
const int  f
 

CAMAC command (no data).

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (8..15, 24..31)
Returns:
void

Referenced by cclc(), cclm(), frontend_init(), and read_trigger_event().

EXTERNAL INLINE int EXPRT camc_chk const int  c  ) 
 

Crate presence check.

Parameters:
c crate number (0..)
Returns:
0:Success, -1:No CAMAC response

EXTERNAL INLINE void EXPRT camc_q const int  c,
const int  n,
const int  a,
const int  f,
int *  q
 

CAMAC command with Q response (no data).

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (8..15, 24..31)
q Q response (0:no Q, 1:Q)
Returns:
void

Referenced by cfsa(), cssa(), ctlm(), and read_trigger_event().

EXTERNAL INLINE void EXPRT camc_sa const int  c,
const int  n,
const int  a,
const int  f,
const int  r
 

Scan CAMAC command on sub-address.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (8..15, 24..31)
r number of consecutive sub-address to read
Returns:
void

EXTERNAL INLINE void EXPRT camc_sn const int  c,
const int  n,
const int  a,
const int  f,
const int  r
 

Scan CAMAC command on station.

Parameters:
c crate number (0..)
n station number (0..30)
a sub-address (0..15)
f function (8..15, 24..31)
r number of consecutive station to read
Returns:
void

EXTERNAL INLINE void EXPRT cami const int  c,
const int  n,
const int  a,
const int  f,
WORD *  d
 

Same as cam16i()

EXTERNAL INLINE void EXPRT camo const int  c,
const int  n,
const int  a,
const int  f,
WORD  d
 

Same as cam16o()

Referenced by frontend_init(), and read_trigger_event().

EXTERNAL INLINE void EXPRT camop  ) 
 

Definition at line 744 of file mcstd.h.


Midas DOC Version 1.9.5 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk