Rev 77 | Rev 100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 77 | Rev 97 | ||
---|---|---|---|
Line 70... | Line 70... | ||
70 | { |
70 | { |
71 | 71 | ||
72 | CVErrorCodes result; |
72 | CVErrorCodes result; |
73 | int ncount=0; |
73 | int ncount=0; |
74 | while (1){ |
74 | while (1){ |
- | 75 | ||
75 | result = CAENVME_WriteCycle(Handle, Address, Data, AM, DW ); |
76 | result = CAENVME_WriteCycle(Handle, Address, Data, AM, DW ); |
76 | if (result !=cvSuccess ) { |
77 | if (result !=cvSuccess ) { |
77 | VMEerrors++; |
78 | VMEerrors++; |
78 | printf("CAENVME_WriteCycle at 0x%0lX failed! data=0x%0X AM= 0x%0X DW= 0x%0X err=%s\n", Address, *((uint32_t *) Data),AM,DW, CAENVME_DecodeError(result)); |
79 | printf("CAENVME_WriteCycle at 0x%0lX failed! data=0x%0X AM= 0x%0X DW= 0x%0X err=%s\n", Address, *((uint32_t *) Data),AM,DW, CAENVME_DecodeError(result)); |
79 | if (ncount==10) return (result); |
80 | if (ncount==10) return (result); |
Line 81... | Line 82... | ||
81 | } |
82 | } |
82 | return result; |
83 | return result; |
83 | } |
84 | } |
84 | 85 | ||
85 | 86 | ||
86 | 87 | ||
87 | 88 | ||
88 | uint32_t *WStackAddrs = NULL; |
89 | uint32_t *WStackAddrs = NULL; |
89 | uint32_t *WStackBuffer; |
90 | uint32_t *WStackBuffer; |
90 | short WStackNCycles; |
91 | unsigned short WStackNCycles; |
91 | short WStackMaxCycles= |
92 | unsigned short WStackMaxCycles=100; |
92 | CVAddressModifier *WStackAMs; |
93 | CVAddressModifier *WStackAMs; |
93 | CVDataWidth *WStackDWs; |
94 | CVDataWidth *WStackDWs; |
94 | CVErrorCodes *WStackECs; |
95 | CVErrorCodes *WStackECs; |
95 | 96 | ||
96 | 97 | ||
97 | uint32_t *RStackAddrs =NULL; |
98 | uint32_t *RStackAddrs =NULL; |
98 | short RStackNCycles; |
99 | unsigned short RStackNCycles; |
99 | short RStackMaxCycles= |
100 | unsigned short RStackMaxCycles=1000; |
100 | CVAddressModifier *RStackAMs; |
101 | CVAddressModifier *RStackAMs; |
101 | CVDataWidth *RStackDWs; |
102 | CVDataWidth *RStackDWs; |
102 | CVErrorCodes *RStackECs; |
103 | CVErrorCodes *RStackECs; |
103 | 104 | ||
104 | 105 | ||
Line 180... | Line 181... | ||
180 | printf("%d ADDR= 0x%0X AM= 0x%0X DW= 0x%0X data= 0x%0X failed! err=%s\n", i,WStackAddrs[i],WStackAMs[i], WStackDWs[i], WStackBuffer[i], CAENVME_DecodeError(WStackECs[i]) ); |
181 | printf("%d ADDR= 0x%0X AM= 0x%0X DW= 0x%0X data= 0x%0X failed! err=%s\n", i,WStackAddrs[i],WStackAMs[i], WStackDWs[i], WStackBuffer[i], CAENVME_DecodeError(WStackECs[i]) ); |
181 | } |
182 | } |
182 | exit(result); |
183 | exit(result); |
183 | } |
184 | } |
184 | return WStackNCycles; |
185 | return WStackNCycles; |
185 | } |
186 | } |
186 | 187 | ||
187 | 188 | ||
188 | short __stdcall CAEN_VME_R( uint16_t AddressModifier, uint16_t DataWidth, uint32_t VME_Address, uint32_t *Data){ |
189 | short __stdcall CAEN_VME_R( uint16_t AddressModifier, uint16_t DataWidth, uint32_t VME_Address, uint32_t *Data){ |
189 | return CAEN_VME_read( CAEN_udev, VME_Address, (void *)Data, AddressModifier, DataWidth); |
190 | return CAEN_VME_read( CAEN_udev, VME_Address, (void *)Data, AddressModifier, DataWidth); |
190 | } |
191 | } |
191 | 192 | ||
192 | short __stdcall CAEN_VME_W( uint16_t AddressModifier, uint16_t DataWidth, uint32_t VME_Address, uint32_t Data){ |
193 | short __stdcall CAEN_VME_W( uint16_t AddressModifier, uint16_t DataWidth, uint32_t VME_Address, uint32_t Data){ |
193 | return CAEN_VME_write( CAEN_udev, VME_Address, |
194 | return CAEN_VME_write( CAEN_udev, VME_Address, &Data, AddressModifier, DataWidth); |
194 | } |
195 | } |
195 | 196 | ||
196 | short __stdcall CAEN_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data){ |
197 | short __stdcall CAEN_VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data){ |
197 | 198 | ||
198 | return CAEN_VME_appendwrite( VME_Address, &Data ,AM , DW) ; |
199 | return CAEN_VME_appendwrite( VME_Address, &Data ,AM , DW) ; |
Line 218... | Line 219... | ||
218 | 219 | ||
219 | return CAEN_VME_MultiReadReset(); |
220 | return CAEN_VME_MultiReadReset(); |
220 | 221 | ||
221 | } |
222 | } |
222 | short __stdcall CAEN_VME_MREXEC( uint32_t *Data ){ |
223 | short __stdcall CAEN_VME_MREXEC( uint32_t *Data ){ |
- | 224 | return CAEN_VME_MultiReadExecute(CAEN_udev, Data); |
|
223 | 225 | ||
224 | return 0; |
- | |
225 | 226 | ||
226 | } |
227 | } |
227 | 228 | ||
228 | 229 | ||
229 | 230 |