/**************************************************************************** * * tdc1290Config.c - configuration library file for tdc CAEN 1290 * * SP, 10-Dec-2013 * SP, 18-Dec-2013 - all config.library now included in tdc1190.c * this file almost empty: just for some useful info * and for including it into dsc2_ConfCheck.c * which collects all config.library to play with tcpClient * * * empty lines and line startes with # - will be ignored * config file format: CRATE rocbcal1 <- ROC/crate name, usually IP name TDC1290_ALLSLOTS <- just keyword - all settings after this line will be implemented # for all slots, till TDC1290_SLOTS will be met TDC1290_SLOTS 3 8 19 <- slot_numbers - in which next settings will be implemented # till file ends or next TDC1290_SLOTS will be met TDC1290_B_REV 0x00000002 <- board revision TDC1290_ID 0x050a <- board type # /---- slots ## # 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 TDC1290_ALLSN 0 0 0061 0014 0015 0016 0017 0018 0019 0020 0 0 0023 0024 0025 0026 0027 0037 0035 0043 0 TDC1290_SN 19 0035 <- single board Serial Number: sl# , SN TDC1290_BERR_FIFO 1 <- DMA Nwords method readout: 0 - use VME BUS error # 1 - use event fifo TDC1290_BLT_EVENTS 1 <- to set BLT Event Number Register TDC1290_N_HITS 64 <- to set Max Number of Hits per Event (1,2,4,8,16,32,64,128) TDC1290_ALMOSTFULL 16384 <- set number of words in output buffer # default is 64 words, max is 32735 words TDC1290_OUT_PROG 2 <- set the function for the output on the control connector # 0 : Data Ready # 1 : Full # 2 : Almost Full # 3 : Error TDC1290_W_WIDTH 750 <- Trigger Window Width, in ns (from 25 to 51175) TDC1290_W_OFFSET -1750 <- Trigger Window Offset, in ns (from -51175 to 1000) TDC1290_W_EXTRA 25 <- Extra Search Margin (after window), in ns (from 0 to 1250) TDC1290_W_REJECT 50 <- Reject Margin (before window), in ns (from 0 to 1250) TDC1290_EDGE 2 <- set Edge Detection: 1-trailing edge, 2-leading, 3-both # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - channels ## TDC1290_MASK1 1 1 1 1 1 1 1 0 0 0 1 1 0 1 1 0 <- enable mask for ch.0-15 TDC1290_MASK2 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 <- enable mask for ch.16-31 cc -rdynamic -shared -o tdc1290Config.so tdc1290Config.c -I/home/halld/test_setup/coda/linuxvme/include /home/halld/test_setup/coda/linuxvme/jvme/libjvme.a /home/halld/test_setup/coda/linuxvme/tdc1290/libtdc1190.a -ldl -lpthread -lrt /home/halld/test_setup/coda/linuxvme/tdc1290/tdc1190.c /home/halld/test_setup/coda/linuxvme/tdc1290/tdc1190.h tcpClient rocbcal1 "tdc1190Init(0x09A00000,0,1,0)" tcpClient rocbcal1 "tdc1290Config('/home/halld/test_setup/rocbcal1/tdc1290_example.cnf')" tcpClient rocbcal1 "tdc1290Mon(0)" ======================================================================== hostname=>rocbcal1< portnum=5001 tdc CAEN 1290 number 0 in slot 19 Board Type/ID = 0x050a Board Revision = 0x00000002 Board Serial Number = 0035 Channel Mask = 0xfff16c7f DMA settings: D64 DMA (MBLT) readout Nwords method: use event fifo tdc1190ReadTriggerConfiguration(0): Window Width = 750 ns Window Offset = -1750 ns Extra Seach Margin = 25 ns Reject Margin = 50 ns Trigger Time Subtraction = 1 tdc1190ReadEdgeDetectionConfig(0): Mode = leading edge Acquisition Mode = Trigger Matching Output Buffer status = Not Full BLT Event Number = 1 Max Number of Hits per Event = 64 Almost Full Level set to 16384 (0x4000) words ======================================================================== tcpClient rocbcal1 "tdc1190Status(0)" ======================================================================== STATUS for v1190 TDC at VME (USER) base address 0x9a00000 (0xaf94e000) ---------------------------------------------- Interrupts Disabled Data Status Events to transfer via BLT = 0x0001 Status = 0x0038 (No Data) Events Stored = 0 Total Events = 0 Almost Full = 16384 TDC Mode/Status Resolution : 25 ps Trigger Matching: On TDC Headers/EOB : On Bus Errors : Off TDC Errors : 0:0 1:0 2:0 3:0 ======================================================================== tcpClient rocbcal1 "tdc1190Config(1)" ======================================================================== unknown readout mode, use D32 single word readout Nwords method: use event fifo start v1190/v1290 initialization Acquisition Mode: Trigger Matching Set Window Width to 4600 ns Set Window Offset to -4000 ns Set Extra Search Margin to 25 ns Set Reject Margin to 50 ns Window Width = 4600 ns Window Offset = -4000 ns Extra Seach Margin = 25 ns Reject Margin = 50 ns Trigger Time Subtruction = 1 SetEdgeDetectionConfig: set leading edge only ReadEdgeDetectionConfig: value=2 (0x2) ReadEdgeDetectionConfig: leading edge tdc890EventFifo befor: 0x0020 tdc890EventFifo after: 0x0120 ifull=0 end v1190 disable VME BUS error for event fifo readout reset BUSerror tdc1190Align64 before: 0x0120 tdc1190Align64 after: 0x0130 BLT Event Number set to 1 tdc1190SetMaxNumberOfHitsPerEvent(0): Set Maximum Number Of Hits Per Event to 64 Almost Full Level set to 16384 (0x4000) words ======================================================================== */ #if defined(VXWORKS) || defined(Linux_vme) #ifdef VXWORKS #include #include #include #else #include "jvme.h" #endif #include #include #include #include "tdc1190.h" #else /* dummy version*/ void tdc1290Config_dummy() { return; } #endif