MIDAS
Loading...
Searching...
No Matches
camac_scan.cxx
Go to the documentation of this file.
1
/********************************************************************\
2
Name: camac_scan.cxx
3
Created by: Konstantin Olchanski
4
5
Contents: Scan CAMAC crates
6
\********************************************************************/
7
8
#include <stdio.h>
9
#include <stdint.h>
10
#include <string.h>
11
#include <unistd.h>
12
13
#include "
mcstd.h
"
14
15
int
main
(
int
argc,
char
*argv[])
16
{
17
int
status
;
18
19
status
=
cam_init
();
20
if
(
status
!= 1) {
21
printf(
"Error: Cannot initialize camac: cam_init status %d\n"
,
status
);
22
return
1;
23
}
24
25
for
(
int
c
=0;
c
<=1;
c
++) {
26
printf(
"Scan of CAMAC crate %d:\n"
,
c
);
27
for
(
int
n
=1;
n
<=24;
n
++) {
28
int
a = 0;
29
int
f = 0;
// read
30
int
x = 0;
31
int
q
= 0;
32
DWORD
read_data = 0;
33
cam24i_q
(
c
,
n
, a, f, &read_data, &x, &
q
);
34
if
(x ||
q
)
35
printf(
"C=%2d, N=%2d, X=%d, Q=%d, data=0x%08x\n"
,
c
,
n
, x,
q
, read_data);
36
//sleep(1);
37
}
38
}
39
40
return
0;
41
}
42
43
// end
cam_init
EXTERNAL int EXPRT cam_init(void)
cam24i_q
EXTERNAL void EXPRT cam24i_q(const int c, const int n, const int a, const int f, DWORD *d, int *x, int *q)
DWORD
unsigned int DWORD
Definition
mcstd.h:51
q
static std::string q(const char *s)
Definition
msequencer.cxx:141
main
int main()
Definition
hwtest.cxx:23
n
DWORD n[4]
Definition
mana.cxx:247
mcstd.h
status
DWORD status
Definition
odbhist.cxx:39
c
char c
Definition
system.cxx:1310
examples
camac
camac_scan.cxx
Generated on Sun May 4 2025 05:01:04 for MIDAS by
1.9.8