Rev 87 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
76 | f9daq | 1 | #include "vme.h" |
2 | |||
3 | /* |
||
4 | #ifdef _CVI_ |
||
5 | #include "c:\home\CVI\instr\WIENVME_DLL\wienvme_dll.h" |
||
6 | #else |
||
7 | #include "wienvme_dll.h" |
||
8 | #endif |
||
9 | */ |
||
10 | |||
11 | #include "CAENV1718.h" |
||
12 | #include "wusbvme_dll.h" |
||
13 | #include "wienvme_dll.h" |
||
14 | |||
15 | static int VME_interface= -1; |
||
16 | |||
17 | int VME_CONNECTED(){ |
||
18 | |||
19 | return VME_interface; |
||
20 | } |
||
21 | |||
22 | short VME_START (int interface) |
||
23 | { |
||
24 | |||
25 | |||
26 | VME_interface=interface; |
||
27 | switch (VME_interface){ |
||
28 | case CAEN_V1718: |
||
29 | CAEN_VME_START (NULL); |
||
30 | VME_R_Ptr = CAEN_VME_R; |
||
31 | VME_W_Ptr = CAEN_VME_W; |
||
32 | |||
33 | VME_MW_Ptr = CAEN_VME_MW; |
||
34 | VME_MR_Ptr = CAEN_VME_MR; |
||
35 | |||
36 | VME_MW_Ptr = CAEN_VME_MW; |
||
37 | VME_MR_Ptr = CAEN_VME_MR; |
||
38 | |||
39 | VME_MWEXEC_Ptr = CAEN_VME_MWEXEC; |
||
40 | VME_MREXEC_Ptr = CAEN_VME_MREXEC; |
||
41 | |||
42 | VME_MWRST_Ptr = CAEN_VME_MWRST; |
||
43 | VME_MRRST_Ptr = CAEN_VME_MRRST; |
||
44 | |||
45 | |||
46 | break; |
||
47 | |||
48 | case WIENER_VMEMM: |
||
49 | WIENVME_VME_START(NULL); |
||
50 | VME_R_Ptr = WIENVME_VME_R; |
||
51 | VME_W_Ptr = WIENVME_VME_W; |
||
52 | |||
53 | VME_MW_Ptr = WIENVME_VME_MW; |
||
54 | VME_MR_Ptr = WIENVME_VME_MR; |
||
55 | |||
56 | VME_MW_Ptr = WIENVME_VME_MW; |
||
57 | VME_MR_Ptr = WIENVME_VME_MR; |
||
58 | |||
59 | VME_MWEXEC_Ptr = WIENVME_VME_MWEXEC; |
||
60 | VME_MREXEC_Ptr = WIENVME_VME_MREXEC; |
||
61 | |||
62 | VME_MWRST_Ptr = WIENVME_VME_MWRST; |
||
63 | VME_MRRST_Ptr = WIENVME_VME_MRRST; |
||
64 | break; |
||
65 | case WIENER_VMUSB: |
||
66 | WIENER_VMUSB_VME_START("VM0120"); |
||
67 | VME_R_Ptr = WIENER_VMUSB_VME_R; |
||
68 | VME_W_Ptr = WIENER_VMUSB_VME_W; |
||
69 | |||
70 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
71 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
72 | |||
73 | VME_MW_Ptr = WIENER_VMUSB_VME_MW; |
||
74 | VME_MR_Ptr = WIENER_VMUSB_VME_MR; |
||
75 | |||
76 | VME_MWEXEC_Ptr = WIENER_VMUSB_VME_MWEXEC; |
||
77 | VME_MREXEC_Ptr = WIENER_VMUSB_VME_MREXEC; |
||
78 | |||
79 | VME_MWRST_Ptr = WIENER_VMUSB_VME_MWRST; |
||
80 | VME_MRRST_Ptr = WIENER_VMUSB_VME_MRRST; |
||
81 | break; |
||
82 | |||
83 | } |
||
84 | |||
85 | return 0; |
||
86 | } |
||
87 | |||
88 | short VME_STOP () |
||
89 | { |
||
90 | switch (VME_interface){ |
||
91 | case CAEN_V1718: |
||
92 | |||
93 | CAEN_VME_STOP( ); |
||
94 | break; |
||
95 | |||
96 | case WIENER_VMEMM: |
||
97 | |||
98 | break; |
||
99 | case WIENER_VMUSB: |
||
100 | WIENER_VMUSB_VME_STOP( ); |
||
101 | break; |
||
102 | default: |
||
103 | |||
104 | break; |
||
105 | |||
106 | } |
||
107 | |||
108 | VME_interface = -1; |
||
109 | return 0; |
||
110 | } |