We now have two options for setting the DAC values from Run Control. Both rely on the "LoadDACs" expert option being checked (otherwise, the DAC code is never called). If the "DacFromHdb" box in unchecked, then the DAC's are set from the 6 parameters available in Run Control:
CotDacVoltage0 = ATN --> attenuation (0=off,3500=on) CotDacVoltage1 = DTH --> threshold (default 225) CotDacVoltage2 = TRE --> trigger reference (even) CotDacVoltage3 = TRO --> trigger reference (odd) CotDacVoltage4 = QEN --> Q-enable (0=enabled,3500=disabled) CotDacVoltage5 = QDR --> output width (default 0)and all superlayers and quadrants are set identically. If "DacFromHdb" is checked, then Run Control will read all DAC values from the Hardware Database, and we then have superlayer/quadrant control. At this point, the 32 channels of each DAC can only be set from the "cardEditor" GUI, described below. I hope to make this easier by adding database write capability to "setcv". As a reminder, the map of the DAC's is:
Quadrant Crate DAC address West-A b0cot02 0xE880 West-B b0cot03 0xE580 West-C b0cot06 0xE680 West-D b0cot09 0xE380 East-A b0cot12 0xE780 East-B b0cot13 0xE180 East-C b0cot17 0xE480 East-D b0cot19 0xE280Each DAC controls the four superlayers of an East/West quadrant, (1,4,5,8) for the East and (2,3,6,7) for the West, which I refer to as (A,B,C,D) below. We therefore have 8 spare channels for each DAC, which also get settings from the database. As a check, I have set one of the spares in b0cot02 to -99 mV. Therefore, you can use "setcv" to read these and see if Run Control has loaded values correctly. From the setcv directory, enter the command:
setcv -do b0cot02 e880 -drand you will get the output:
DAC(0): b0cot02 (0xE880) opened, CSR(0) 0x02 = 0x5800
BID(0): 0x00 = 0x1780
CSR(0): 0x02 = 0x5880
ADC(0): 0x04 = 0x07F8
C01(0): 0x40 = 0x0800 (+0000 mV) C17(0): 0x60 = 0x0800 (+0000 mV)
C02(0): 0x42 = 0x085C (+0225 mV) C18(0): 0x62 = 0x0800 (+0000 mV)
C03(0): 0x44 = 0x0800 (+0000 mV) C19(0): 0x64 = 0x0800 (+0000 mV)
C04(0): 0x46 = 0x0800 (+0000 mV) C20(0): 0x66 = 0x0856 (+0210 mV)
C05(0): 0x48 = 0x0800 (+0000 mV) C21(0): 0x68 = 0x0800 (+0000 mV)
C06(0): 0x4A = 0x0800 (+0000 mV) C22(0): 0x6A = 0x0800 (+0000 mV)
C07(0): 0x4C = 0x0800 (+0000 mV) C23(0): 0x6C = 0x0800 (+0000 mV)
C08(0): 0x4E = 0x085C (+0225 mV) C24(0): 0x6E = 0x0800 (+0000 mV)
C09(0): 0x50 = 0x0800 (+0000 mV) C25(0): 0x70 = 0x0800 (+0000 mV)
C10(0): 0x52 = 0x0800 (+0000 mV) C26(0): 0x72 = 0x0800 (+0000 mV)
C11(0): 0x54 = 0x0800 (+0000 mV) C27(0): 0x74 = 0x0800 (+0000 mV)
C12(0): 0x56 = 0x0800 (+0000 mV) C28(0): 0x76 = 0x0800 (+0000 mV)
C13(0): 0x58 = 0x0800 (+0000 mV) C29(0): 0x78 = 0x0800 (+0000 mV)
C14(0): 0x5A = 0x085C (+0225 mV) C30(0): 0x7A = 0x0800 (+0000 mV)
C15(0): 0x5C = 0x0800 (+0000 mV) C31(0): 0x7C = 0x07D7 (-0100 mV)
C16(0): 0x5E = 0x0800 (+0000 mV) C32(0): 0x7E = 0x0800 (+0000 mV)
You can see that all DTH are set to 225, except for SL7 at 210. All other
control voltages should be zero. Also, the spare channel 31 (corresponding,
of course, to DACVOLTAGE30 in the database) reads -100 mV (remember the DAC
is 12-bit, so has 2.4 mV resolution).
COT DAC values are stored in the hardware database and edited with the database program "cardEditor". This program can be run from the B0 machines, and used if one has a database account (see Bill Badgett):
"File" menu --> "Change Database Connection --> enter user/pass
"Cards" --> COT_02 --> click on COTDAC_00
"Edit" menu --> "Edit/View Selected Cards"
DACVOLTAGE0 = SLA ATN
DACVOLTAGE1 = SLA DTH
DACVOLTAGE2 = SLA TRE
DACVOLTAGE3 = SLA TRO
DACVOLTAGE4 = SLA QEN
DACVOLTAGE5 = SLA QDR
DACVOLTAGE6 = SLB ATN
DACVOLTAGE7 = SLB DTH
DACVOLTAGE8 = SLB TRE
DACVOLTAGE9 = SLB TRO
DACVOLTAGE10 = SLB QEN
DACVOLTAGE11 = SLB QDR
DACVOLTAGE12 = SLC ATN
DACVOLTAGE13 = SLC DTH
DACVOLTAGE14 = SLC TRE
DACVOLTAGE15 = SLC TRO
DACVOLTAGE16 = SLC QEN
DACVOLTAGE17 = SLC QDR
DACVOLTAGE18 = SLD ATN
DACVOLTAGE19 = SLD DTH
DACVOLTAGE20 = SLD TRE
DACVOLTAGE21 = SLD TRO
DACVOLTAGE22 = SLD QEN
DACVOLTAGE23 = SLD QDR
DACVOLTAGE24 = spare
DACVOLTAGE25 = spare
DACVOLTAGE26 = spare
DACVOLTAGE27 = spare
DACVOLTAGE28 = spare
DACVOLTAGE29 = spare
DACVOLTAGE30 = spare
DACVOLTAGE31 = spare