MIDAS
Loading...
Searching...
No Matches
fevmemodules.c
Go to the documentation of this file.
1/********************************************************************\
2
3 Name: fevmemodules.c
4 Created by:
5
6 Contents: C code example of standarized frontend dealing with
7 common VME module at Triumf.
8 Used with the VMIC Fanuc VME processor board.
9 Missing parameters for the V1729
10
11 $Id$
12\********************************************************************/
13#undef V792_CODE
14#undef VADC0_CODE
15#undef VADC1_CODE
16#undef VADC2_CODE
17#undef VADC3_CODE
18#undef VTDC0_CODE
19#define VF48_CODE
20#undef VMEIO_CODE
21#undef V1729_CODE
22
23#include <stdio.h>
24#include <stdlib.h>
25#include "midas.h"
26#include "mvmestd.h"
27#include "vmicvme.h"
28#include "vmeio.h"
29#include "v1190B.h"
30#include "v792.h"
31#include "vf48.h"
32#include "v1729.h"
33#include "experim.h"
34
35// VMEIO definition
36#define P_BOE 0x1 //
37#define P_EOE 0x2 //
38#define P_CLR 0x4 //
39#define S_READOUT 0x8 //
40#define S_RUNGATE 0x10 //
41
42/* Interrupt vector */
43int trig_level = 0;
44#define TRIG_LEVEL (int) 1
45#define INT_LEVEL (int) 3
46#define INT_VECTOR (int) 0x16
47extern INT_INFO int_info;
49
50/* make frontend functions callable from the C framework */
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55/*-- Globals -------------------------------------------------------*/
56
57/* The frontend name (client name) as seen by other MIDAS clients */
58char *frontend_name = "fevmemodules";
59/* The frontend file name, don't change it */
61
62/* frontend_loop is called periodically if this variable is TRUE */
64
65/* a frontend status page is displayed with this frequency in ms */
67
68/* maximum event size produced by this frontend */
70
71/* maximum event size for fragmented events (EQ_FRAGMENTED) */
72INT max_event_size_frag = 5 * 1024 * 1024;
73
74/* buffer size to hold events */
75INT event_buffer_size = 10 * 100000;
76
77/* Hardware */
79int sRG = 0; // state run gate
80int intflag = 0;
81int inRun = 0, missed=0;
82int done=0, stop_req=0;
84
85/* VME base address */
86DWORD VMEIO_BASE = 0x780000;
87DWORD VTDC0_BASE = 0xF10000;
88DWORD VADC0_BASE = 0x100000;
89DWORD VADC1_BASE = 0x200000;
90DWORD VADC2_BASE = 0x300000;
91DWORD VADC3_BASE = 0x400000;
92 // DWORD VLAM_BASE = 0x500000;
93DWORD VLAM_BASE = 0x800000;
94DWORD VF48_BASE = 0xAF0000;
95DWORD V1729_BASE = 0x120000;
96/* Globals */
97#define N_ADC 100
98#define N_TDC 100
99#define N_PTS 5000
100extern HNDLE hDB;
103
104/* number of channels */
105#define N_SCLR 4
106
107/*-- Function declarations -----------------------------------------*/
108
111INT begin_of_run(INT run_number, char *error);
112INT end_of_run(INT run_number, char *error);
113INT pause_run(INT run_number, char *error);
114INT resume_run(INT run_number, char *error);
116extern void interrupt_routine(void);
117
118INT read_trigger_event(char *pevent, INT off);
119INT read_scaler_event(char *pevent, INT off);
120
122
124
125 /* online banks */
126 {"ADC0", TID_DWORD, N_ADC, NULL}
127 ,
128 {"ADC1", TID_DWORD, N_ADC, NULL}
129 ,
130 {"ADC2", TID_DWORD, N_ADC, NULL}
131 ,
132 {"ADC3", TID_DWORD, N_ADC, NULL}
133 ,
134 {"TDC0", TID_DWORD, N_TDC, NULL}
135 ,
136
137 {"WAVE", TID_DWORD, N_TDC, NULL}
138 ,
139 {"FWAV", TID_DWORD, N_PTS, NULL}
140 ,
141
142 {""}
143 ,
144};
145
146/*-- Equipment list ------------------------------------------------*/
147
148#undef USE_INT
149
151
152 {"Trigger", /* equipment name */
153 {1, 0, /* event ID, trigger mask */
154 "SYSTEM", /* event buffer */
155#ifdef USE_INT
156 EQ_INTERRUPT, /* equipment type */
157#else
158 EQ_PERIODIC, // POLLED, /* equipment type */
159#endif
160 LAM_SOURCE(0, 0x0), /* event source crate 0, all stations */
161 "MIDAS", /* format */
162 TRUE, /* enabled */
163 RO_RUNNING, /* read only when running */
164 500, /* poll for 500ms */
165 0, /* stop run after this event limit */
166 0, /* number of sub events */
167 0, /* don't log history */
168 "", "", "",},
169 read_trigger_event, /* readout routine */
170 NULL, NULL,
172 }
173 ,
174
175 {"Scaler", /* equipment name */
176 {2, 0, /* event ID, trigger mask */
177 "SYSTEM", /* event buffer */
178 EQ_PERIODIC , /* equipment type */
179 0, /* event source */
180 "MIDAS", /* format */
181 FALSE, /* enabled */
182 RO_RUNNING | RO_TRANSITIONS | /* read when running and on transitions */
183 RO_ODB, /* and update ODB */
184 10000, /* read every 10 sec */
185 0, /* stop run after this event limit */
186 0, /* number of sub events */
187 0, /* log history */
188 "", "", "",},
189 read_scaler_event, /* readout routine */
190 },
191
192 {""}
193};
194
195#ifdef __cplusplus
196}
197#endif
198
199/********************************************************************\
200 Callback routines for system transitions
201
202 These routines are called whenever a system transition like start/
203 stop of a run occurs. The routines are called on the following
204 occations:
205
206 frontend_init: When the frontend program is started. This routine
207 should initialize the hardware.
208
209 frontend_exit: When the frontend program is shut down. Can be used
210 to releas any locked resources like memory, commu-
211 nications ports etc.
212
213 begin_of_run: When a new run is started. Clear scalers, open
214 rungates, etc.
215
216 end_of_run: Called on a request to stop a run. Can send
217 end-of-run event and close run gates.
218
219 pause_run: When a run is paused. Should disable trigger events.
220
221 resume_run: When a run is resumed. Should enable trigger events.
222\********************************************************************/
223
224/********************************************************************/
225
226/*-- Sequencer callback info --------------------------------------*/
228{
229 printf("odb ... trigger settings touched\n");
230}
231
232/*-- Frontend Init -------------------------------------------------*/
234{
235 int size, status;
236 char set_str[80];
237
238 /* Book Setting space */
240
241 /* Map /equipment/Trigger/settings for the sequencer */
242 sprintf(set_str, "/Equipment/Trigger/Settings");
245 if (status != DB_SUCCESS)
246 cm_msg(MINFO,"FE","Key %s not found", set_str);
247
248 /* Enable hot-link on settings/ of the equipment */
249 size = sizeof(TRIGGER_SETTINGS);
250 if ((status = db_open_record(hDB, hSet, &ts, size, MODE_READ
252 return status;
253
254 // Open VME interface
255 status = mvme_open(&myvme, 0);
256
257 // Set am to A24 non-privileged Data
259
260 // Set dmode to D32
262
263#if defined V1729_CODE
264 // Collect Pedestals
266
267 // Do vernier calibration
269#endif
270
271 /* print message and return FE_ERR_HW if frontend should not be started */
272
273 return SUCCESS;
274}
275
276/*-- Frontend Exit -------------------------------------------------*/
277
279{
280 return SUCCESS;
281}
282
283/*-- Begin of Run --------------------------------------------------*/
284
286{
287 int i, csr, status, size;
288 /* put here clear scalers etc. */
289
290 /* read Triggger settings */
291 size = sizeof(TRIGGER_SETTINGS);
292 if ((status = db_get_record (hDB, hSet, &ts, &size, 0)) != DB_SUCCESS)
293 return status;
294
295 // Set am to A24 non-privileged Data
297
298 // Set dmode to D32
300
301#if defined VTDC0_CODE
302 //-------- TDCs -------------------------------------------
303 // Check the TDC
305 printf("Firmware revision: 0x%x\n", csr);
306
307 // Set mode 1
309
310 if (ts.v1190.leresolution == 100)
312 else if (ts.v1190.leresolution == 200)
314 else if (ts.v1190.leresolution == 800)
316 else
317 temp = 3;
318 if (temp != 2)
320
321 // Adjust window width to 10us
322 // 10us == 0x18F
323 temp = (DWORD) abs(ts.v1190.windowwidth / 25e-9);
325
326 // Adjust offset width to 10us
327 // 10us == 0xE70
328 temp = ts.v1190.windowoffset / 25e-9;
329 temp = temp < 0 ? ((DWORD)temp&0xFFF): (DWORD) temp;
331
332 // Print Current status
333 printf("BOR : FELIXE V1190B settings\n");
335#endif
336
337#if defined V792_CODE
338 //-------- ADCs ------------------------------------------
339 printf("ADC0\n");
341 printf("ADC1\n");
343 printf("ADC2\n");
345 printf("ADC3\n");
347
348 /* Initialize the V792s ADC0 --*/
349 /* Load Threshold */
350 for (i=0;i<V792_MAX_CHANNELS;i+=2) {
351 printf("B Threshold[%i] = 0x%4.4x\t - ", i, ts.v792.threshold1[i]);
352 printf("Threshold[%i] = 0x%4.4x\n", i+1, ts.v792.threshold1[i+1]);
353 }
355
356 for (i=0;i<V792_MAX_CHANNELS;i+=2) {
357 printf("Threshold[%i] = 0x%4.4x\t - ", i, ts.v792.threshold1[i]);
358 printf("Threshold[%i] = 0x%4.4x\n", i+1, ts.v792.threshold1[i+1]);
359 }
360
363 printf("Data Ready ADC0: 0x%x\n", csr);
364
365 /* Initialize the V792s ADC1 --*/
366 /* Load Threshold */
367 v792_ThresholdWrite(myvme, VADC1_BASE, (WORD *)&(ts.v792.thresholds2));
370 printf("Data Ready ADC1: 0x%x\n", csr);
371
372 /* Initialize the V792s ADC2 --*/
373 /* Load Threshold */
374 v792_ThresholdWrite(myvme, VADC2_BASE, (WORD *)&(ts.v792.thresholds3));
377 printf("Data Ready ADC2: 0x%x\n", csr);
378
379 /* Initialize the V792s ADC3 --*/
380 /* Load Threshold */
381 v792_ThresholdWrite(myvme, VADC3_BASE, (WORD *)&(ts.v792.thresold4));
384 printf("Data Ready ADC3: 0x%x\n", csr);
385#endif
386
387
388#if defined V1729_CODE
389 //-------- 1/2 Gsps ADC (CAEN) -------------------------------------
390 // Set mode 3 (128 full range)
393
394 // Print Current status
396
397 // Start acquisition
399#endif
400
401#if defined VF48_CODE
402 //-------- 20..65 Msps ADC (Uni Montreal) -------------------------
403 /* Initialize the VF48 --*/
405
406 // Stop DAQ for seting up the parameters
408
411 printf("vf48: External trigger mode\n");
412 } else {
414 printf("vf48: Self triggering mode\n");
415 }
417 printf("CSR Buffer: 0x%x\n", csr);
418
419 // Segment Size
421 for (i=0;i<6;i++) {
422 printf("vf48: SegSize grp (%d) %i:%d\n", ts.vf48.segment_size
424 }
425
426 // Set Threshold high for external trigger, as the
427 // the self-trigger is always sending info to the collector
428 // and overwhelming the link. (max maybe 10 bits (0x3FF))
429 // Threshold
430 for (i=0;i<6;i++) {
432 printf("vf48: Trigger Threshold grp (%d) %i:%d\n", ts.vf48.trigger_threshold
434 }
435
436 // Set Threshold high for Hit detection
437 for (i=0;i<6;i++) {
439 printf("vf48: Hit Threshold grp (%d) %i:%d\n", ts.vf48.hit_threshold
441 }
442
443 // Active Channel Mask
444 for (i=0;i<6;i++){
446 printf("vf48: Active channel mask grp (%x) %i:0x%x\n", ts.vf48.active_channel_mask
448 }
449
450 // Raw Data Suppression
451 for (i=0;i<6;i++){
453 printf("vf48: Raw Data Suppress grp (%x) %i:0x%x\n", ts.vf48.raw_data_suppress
455 }
456
457 // Channel Suppress Enable
458 for (i=0;i<6;i++){
460 printf("vf48: Channel Suppression Enable grp (%x) %i:0x%x\n", ts.vf48.channel_suppress_enable
461 , i, 0x1 & vf48_ChSuppRead(myvme, VF48_BASE, i));
462 }
463
464 // Divisor
466 for (i=0;i<6;i++){
467 printf("vf48: Divisor grp (%x) %i:0x%x\n", ts.vf48.divisor
469 }
470
471 // PreTrigger
472 for (i=0;i<6;i++) {
474 printf("vf48: Pre Trigger grp %i:%d\n"
476 }
477
478 // Latency
479 for (i=0;i<6;i++) {
481 printf("vf48: Latency grp %i:%d\n"
483 }
484
485 // K-coef
486 for (i=0;i<6;i++) {
488 printf("vf48: K-coeff grp %i:%d\n"
490 }
491 // L-coef
492 for (i=0;i<6;i++) {
494 printf("vf48: L-coeff grp %i:%d\n"
496 }
497 // M-coef
498 for (i=0;i<6;i++) {
500 printf("vf48: M-coeff grp %i:%d\n"
502 }
503
504 // Polarity
505 for (i=0;i<6;i++) {
506 DWORD pat;
511 } else {
515 }
516 printf("vf48: Polarity grp %i:%d\n"
518 }
519
520 // Group Enable
522 printf("vf48: Group Enable :0x%x\n", vf48_GrpRead(myvme, VF48_BASE));
523
524 // Start ACQ for VF48
526#endif
527
528
529#if defined VMEIO_CODE
530 //-------- VMEIO (triumf board) ----------------------------------
531 // Set am to A24 non-privileged Data
533
534 // Set dmode to D32
536
537 // Set pulse mode
539#endif
540
541 //------ FINAL ACTIONS before BOR -----------
542 // Send Clear pulse
543 // vmeio_SyncWrite(myvme, VMEIO_BASE, P_CLR);
544
545 /* Reset Latch */
546
547 /********* commented out for other test purpose
548 vmeio_SyncWrite(myvme, VMEIO_BASE, P_EOE);
549
550 // Open run gate
551 vmeio_AsyncWrite(myvme, VMEIO_BASE, S_RUNGATE);
552
553 // Disable interrupt
554 mvme_write_value(myvme, VLAM_BASE+4, 0x0);
555
556 // Reset Latch
557 mvme_write_value(myvme, VLAM_BASE, 0x1);
558
559 // Clear pending interrupts
560 mvme_write_value(myvme, VLAM_BASE+8, 0x0);
561 // printf("Vector:0x%lx\n", (mvme_read_value(myvme, VLAM_BASE+0x8) & 0xFF));
562
563 // Enable interrupt
564 inRun = 1;
565 mvme_write_value(myvme, VLAM_BASE+4, inRun);
566 */
567
568 missed = 0; // for the v1729 missed trigger
569 printf("End of BOR\n");
570 return SUCCESS;
571}
572
573/*-- End of Run ----------------------------------------------------*/
575{
576 // Stop DAQ for seting up the parameters
578
579 done = 0;
580 stop_req = 0;
581 inRun = 0;
582 // Disable interrupt
584 trig_level = 0;
585 // Close run gate
587 return SUCCESS;
588}
589
590/*-- Pause Run -----------------------------------------------------*/
592{
593 inRun = 0;
594 // Disable interrupt
596 trig_level = 0;
597 // Close run gate
599
600 return SUCCESS;
601}
602
603/*-- Resume Run ----------------------------------------------------*/
605{
607
608 // EOB Pulse
610
611 // Open run gate
613
614 // Enable interrupt
615 inRun = 1;
617 return SUCCESS;
618}
619
620/*-- Frontend Loop -------------------------------------------------*/
622{
623 /* if frontend_call_loop is true, this routine gets called when
624 the frontend is idle or once between every event */
625 char str[128];
626
627 if (stop_req && done==0) {
628 db_set_value(hDB,0,"/logger/channels/0/Settings/Event limit", &evlimit, sizeof(evlimit), 1, TID_DWORD);
629 if (cm_transition(TR_STOP, 0, str, sizeof(str), ASYNC, FALSE) != CM_SUCCESS) {
630 cm_msg(MERROR, "VF48 Timeout", "cannot stop run: %s", str);
631 }
632 inRun = 0;
633 // Disable interrupt
635 done = 1;
636 cm_msg(MERROR, "VF48 Timeout","VF48 Stop requested");
637 }
638 return SUCCESS;
639}
640
641/*------------------------------------------------------------------*/
642
643/********************************************************************\
644
645 Readout routines for different events
646
647\********************************************************************/
648
649/*-- Trigger event routines ----------------------------------------*/
651 /* Polling routine for events. Returns TRUE if event
652 is available. If test equals TRUE, don't return. The test
653 flag is used to time the polling */
654 // if (vmeio_CsrRead(myvme, VMEIO_BASE))
655 // if (lam > 10)
656{
657 int i;
658 int lam = 0;
659
660 for (i = 0; i < count; i++, lam++) {
662 if (lam)
663 if (!test)
664 return lam;
665 }
666
667 return 0;
668}
669
670/*-- Interrupt configuration ---------------------------------------*/
672{
673 int vec = 0;
674 switch (cmd) {
677 break;
680 break;
686 printf("Interrupt Attached to 0x%x for vector:0x%x\n", adr, vec&0xFF);
687 break;
689 printf("Interrupt Detach\n");
690 break;
691 }
692 return SUCCESS;
693}
694
695/*-- Event readout -------------------------------------------------*/
698{
699#if defined VADC0_CODE
700 DWORD *pdata;
701#endif
702#if defined VTDC0_CODE
703 DWORD *pdata;
704#endif
705#if defined VF48_CODE
706 DWORD *pdata;
707 int status, evtlength;
708#endif
709#if defined V1729_CODE
710 INT *pidata, timeout;
711 WORD data[20000];
712 INT nch, npt, nentry;
713#endif
714
715 evlimit = SERIAL_NUMBER(pevent);
716 // Timing Begin of Event
717 // vmeio_SyncWrite(myvme, VMEIO_BASE, P_BOE);
718 // Open READOUT State
719 // vmeio_AsyncWrite(myvme, VMEIO_BASE, (S_READOUT|S_RUNGATE));
720
721 // > THE LINE BELOW SHOULD BE HERE AND NOWHERE ELSE < !
722 bk_init32(pevent);
723
724#if defined VADC0_CODE
728 /* create structured ADC0 bank */
729 bk_create(pevent, "ADC0", TID_DWORD, &pdata);
731 /* Read Event */
733 pdata += nentry;
734 bk_close(pevent, pdata);
736#endif
737
738#if defined VADC1_CODE
740 /* create structured ADC1 bank */
741 bk_create(pevent, "ADC1", TID_DWORD, &pdata);
742 /* Read Event */
744 pdata += nentry;
745 bk_close(pevent, pdata);
746 // v792_EvtCntReset(myvme, VADC1_BASE);
747#endif
748
749#if defined VADC2_CODE
751 /* create structured ADC2 bank */
752 bk_create(pevent, "ADC2", TID_DWORD, &pdata);
753 /* Read Event */
755 pdata += nentry;
756 bk_close(pevent, pdata);
757#endif
758
759#if defined VADC3_CODE
761 /* create structured ADC3 bank */
762 bk_create(pevent, "ADC3", TID_DWORD, &pdata);
763 /* Read Event */
765 pdata += nentry;
766 bk_close(pevent, pdata);
767#endif
768
769#if defined VTDC0_CODE
771 /* create variable length TDC bank */
772 bk_create(pevent, "TDC0", TID_DWORD, &pdata);
773 /* Read Event */
775 pdata += nentry;
776 /* clear TDC */
777 // v1190_SoftClear(myvme, VTDC0_BASE);
778 bk_close(pevent, pdata);
779#endif
780
781#if defined VF48_CODE
783 /* create variable length WAVE bank */
784 bk_create(pevent, "WAVE", TID_DWORD, &pdata);
786 // printf("read vf48 evtlength:%d\n", evtlength);
787 pdata += (DWORD) evtlength;
788 bk_close(pevent, pdata);
789#endif
790
791#if defined V1729_CODE
793 timeout=20;
794 while(!v1729_isTrigger(myvme, V1729_BASE) && timeout) {
795 timeout--;
796 ss_sleep(1);
797 };
798 if (timeout == 0) {
799 printf("No Trigger evt#:%d missed:%d (%6.2f%%)\n", SERIAL_NUMBER(pevent)
800 , ++missed
801 , 100.*((float)missed/(float)SERIAL_NUMBER(pevent)));
802 }
803 npt = 2560;
804 nch = 4;
806 bk_create(pevent, "FWAV", TID_INT, &pidata);
807 *pidata++ = npt;
808 *pidata++ = data[7];
810 pidata += npt;
811 /*
812 *pidata++ = 0x10000 | npt;
813 v1729_OrderData(myvme, V1729_BASE, data, pidata, nch, 1, npt);
814 pidata += npt;
815 */
816 bk_close(pevent, pidata);
817
818 // Start acquisition
820#endif
821
823 // EOB
824 /*
825 vmeio_AsyncWrite(myvme, VMEIO_BASE, S_RUNGATE);
826 vmeio_SyncWrite(myvme, VMEIO_BASE, P_EOE);
827
828 // Reset Latch EOB
829 mvme_write_value(myvme, VLAM_BASE, 0x0); // Nim out
830 */
831
832 if (evtlength) {
833 // printf("evtlength: %d bk_size:%d\n", evtlength, bk_size(pevent));
834 return bk_size(pevent);
835 }
836 else
837 return 0;
838}
839
840/*-- Scaler event --------------------------------------------------*/
842{
843 DWORD *pdata;
844
845 /* init bank structure */
846 bk_init(pevent);
847
848 /* create SCLR bank */
849 bk_create(pevent, "SCLR", TID_DWORD, &pdata);
850
851 /* read scaler bank */
852 bk_close(pevent, pdata);
853
854 // return bk_size(pevent);
855 // Nothing to send for now
856 return 0;
857}
858
859
#define FALSE
Definition cfortran.h:309
#define TRIGGER_SETTINGS_STR(_name)
Definition experim.h:166
BOOL frontend_call_loop
frontend_loop is called periodically if this variable is TRUE
DWORD VADC2_BASE
int myinfo
void seq_callback(INT hDB, INT hseq, void *info)
int inRun
#define S_RUNGATE
INT max_event_size
maximum event size produced by this frontend
INT frontend_exit()
Frontend exit.
HNDLE hSet
int stop_req
INT frontend_init()
Frontend initialization.
DWORD VADC3_BASE
DWORD VADC0_BASE
INT event_buffer_size
buffer size to hold events
void register_cnaf_callback(int debug)
INT max_event_size_frag
maximum event size for fragmented events (EQ_FRAGMENTED)
INT interrupt_configure(INT cmd, INT source, PTYPE adr)
BANK_LIST trigger_bank_list[]
int done
#define N_PTS
int missed
DWORD VTDC0_BASE
DWORD VF48_BASE
#define N_TDC
int vf48_error
void interrupt_routine(void)
TRIGGER_SETTINGS ts
#define TRIG_LEVEL
#define P_EOE
INT poll_event(INT source, INT count, BOOL test)
Polling routine for events.
INT read_trigger_event(char *pevent, INT off)
EQUIPMENT equipment[]
Main structure for midas equipment.
DWORD VMEIO_BASE
#define INT_VECTOR
DWORD VADC1_BASE
DWORD V1729_BASE
HNDLE hDB
main ODB handle
Definition mana.cxx:207
INT_INFO int_info
INT display_period
a frontend status page is displayed with this frequency in ms
char * frontend_name
The frontend name (client name) as seen by other MIDAS clients.
int sRG
char * frontend_file_name
The frontend file name, don't change it.
#define P_BOE
int trig_level
INT begin_of_run(INT run_number, char *error)
Begin of Run.
INT frontend_loop()
Frontend loop.
DWORD evlimit
#define P_CLR
INT end_of_run(INT run_number, char *error)
End of Run.
MVME_INTERFACE * myvme
#define N_ADC
#define INT_LEVEL
int intflag
INT read_scaler_event(char *pevent, INT off)
Scaler event readout.
DWORD VLAM_BASE
INT bk_close(void *event, void *pdata)
Definition midas.cxx:16780
void bk_init(void *event)
Definition midas.cxx:16406
void bk_init32(void *event)
Definition midas.cxx:16469
void bk_create(void *event, const char *name, WORD type, void **pdata)
Definition midas.cxx:16561
INT bk_size(const void *event)
Definition midas.cxx:16495
INT cm_transition(INT transition, INT run_number, char *errstr, INT errstr_size, INT async_flag, INT debug_flag)
Definition midas.cxx:5286
#define CM_SUCCESS
Definition midas.h:582
#define DB_SUCCESS
Definition midas.h:631
#define CMD_INTERRUPT_ATTACH
Definition midas.h:822
#define CMD_INTERRUPT_DISABLE
Definition midas.h:821
#define CMD_INTERRUPT_ENABLE
Definition midas.h:820
#define CMD_INTERRUPT_DETACH
Definition midas.h:823
unsigned short int WORD
Definition mcstd.h:49
unsigned int DWORD
Definition mcstd.h:51
#define SUCCESS
Definition mcstd.h:54
#define RO_ODB
Definition midas.h:438
#define EQ_PERIODIC
Definition midas.h:414
#define MINFO
Definition midas.h:560
#define MERROR
Definition midas.h:559
#define MODE_READ
Definition midas.h:370
#define EQ_INTERRUPT
Definition midas.h:416
#define TID_INT
Definition midas.h:338
#define RO_TRANSITIONS
Definition midas.h:434
#define TR_STOP
Definition midas.h:406
#define RO_RUNNING
Definition midas.h:426
#define TID_DWORD
Definition midas.h:336
INT ss_sleep(INT millisec)
Definition system.cxx:3628
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
Definition midas.cxx:915
int EXPRT mvme_open(MVME_INTERFACE **vme, int idx)
unsigned int EXPRT mvme_read_value(MVME_INTERFACE *vme, mvme_addr_t vme_addr)
int EXPRT mvme_write_value(MVME_INTERFACE *vme, mvme_addr_t vme_addr, unsigned int value)
int EXPRT mvme_set_dmode(MVME_INTERFACE *vme, int dmode)
int EXPRT mvme_interrupt_attach(MVME_INTERFACE *mvme, int level, int vector, void(*isr)(int, void *, void *), void *info)
int EXPRT mvme_set_am(MVME_INTERFACE *vme, int am)
#define MVME_DMODE_D32
Definition mvmestd.h:82
#define MVME_AM_A24_ND
Definition mvmestd.h:120
INT db_open_record(HNDLE hDB, HNDLE hKey, void *ptr, INT rec_size, WORD access_mode, void(*dispatcher)(INT, INT, void *), void *info)
Definition odb.cxx:13291
std::string strcomb1(const char **list)
Definition odb.cxx:598
INT db_get_record(HNDLE hDB, HNDLE hKey, void *data, INT *buf_size, INT align)
Definition odb.cxx:11709
INT db_set_value(HNDLE hDB, HNDLE hKeyRoot, const char *key_name, const void *data, INT data_size, INT num_values, DWORD type)
Definition odb.cxx:5261
INT db_find_key(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
Definition odb.cxx:4079
INT db_create_record(HNDLE hDB, HNDLE hKey, const char *orig_key_name, const char *init_str)
Definition odb.cxx:12800
void ** info
Definition fesimdaq.cxx:41
INT run_number[2]
Definition mana.cxx:246
void * data
Definition mana.cxx:268
BOOL debug
debug printouts
Definition mana.cxx:254
double count
Definition mdump.cxx:33
INT i
Definition mdump.cxx:32
#define DWORD
Definition mhdump.cxx:31
INT HNDLE
Definition midas.h:132
DWORD BOOL
Definition midas.h:105
int INT
Definition midas.h:129
#define PTYPE
Definition midas.h:170
#define LAM_SOURCE(c, s)
Definition midas.h:469
#define TRUE
Definition midas.h:182
#define SERIAL_NUMBER(e)
Definition midas.h:880
#define resume_run
#define pause_run
program test
Definition miniana.f:6
char str[256]
Definition odbhist.cxx:33
DWORD status
Definition odbhist.cxx:39
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
BOOL raw_data_suppress
Definition experim.h:34
BOOL external_trigger
Definition experim.h:30
struct TRIGGER_SETTINGS::@27 v792
INT active_channel_mask
Definition experim.h:36
INT group_bitwise_all_0x3f_
Definition experim.h:33
DWORD post_trigger
Definition experim.h:58
WORD threshold1[32]
Definition experim.h:47
struct TRIGGER_SETTINGS::@29 v1729
BOOL inverse_signal
Definition experim.h:31
struct TRIGGER_SETTINGS::@28 v1190
BOOL channel_suppress_enable
Definition experim.h:35
struct TRIGGER_SETTINGS::@26 vf48
INT trigger_threshold
Definition experim.h:37
static double e(void)
Definition tinyexpr.c:136