Commit 40fd8194 authored by David Cussans's avatar David Cussans

Checking in changes to test readout Python. Changed connection file to use Control Hub

parent 0aac30c3
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<connections> <connections>
<connection id="minitlu" uri="ipbusudp-2.0://192.168.200.32:50001" address_table="file://miniTLU.xml" /> <connection id="minitlu" uri="chtcp-2.0://localhost:10203?target=192.168.200.32:50001" address_table="file://miniTLU.xml" />
</connections> </connections>
...@@ -105,6 +105,12 @@ print " Count 3 = " , count3 ...@@ -105,6 +105,12 @@ print " Count 3 = " , count3
board.write("InternalTriggerIntervalW",0) board.write("InternalTriggerIntervalW",0)
print "Setting input trigger delay to 31 160MHz clock cycles"
board.write("PulseDelayW",31)
pulseDelay = board.read("PulseDelayR")
print "Pulse delay was set to ", pulseDelay
print "Enabling DUT 0 and 1" print "Enabling DUT 0 and 1"
board.write("DUTMaskW",3) board.write("DUTMaskW",3)
DUTMask = board.read("DUTMaskR") DUTMask = board.read("DUTMaskR")
...@@ -112,6 +118,8 @@ print "DUTMaskR = " , DUTMask ...@@ -112,6 +118,8 @@ print "DUTMaskR = " , DUTMask
print "Ignore veto from shutter" print "Ignore veto from shutter"
board.write("IgnoreShutterVetoW",1) board.write("IgnoreShutterVetoW",1)
#print "Listen for veto from shutter"
#board.write("IgnoreShutterVetoW",0)
IgnoreShutterVeto = board.read("IgnoreShutterVetoR") IgnoreShutterVeto = board.read("IgnoreShutterVetoR")
print "IgnoreShutterVeto = " , IgnoreShutterVeto print "IgnoreShutterVeto = " , IgnoreShutterVeto
...@@ -128,30 +136,38 @@ board.write("EventFifoCSR",0x2) ...@@ -128,30 +136,38 @@ board.write("EventFifoCSR",0x2)
eventFifoFillLevel = board.read("EventFifoFillLevel") eventFifoFillLevel = board.read("EventFifoFillLevel")
print "FIFO fill level after resetting FIFO = " , eventFifoFillLevel print "FIFO fill level after resetting FIFO = " , eventFifoFillLevel
#print "Enabling data recording" print "Enabling data recording"
#board.write("Enable_Record_Data",1) board.write("Enable_Record_Data",1)
print "Disabling data recording" #print "Disabling data recording"
board.write("Enable_Record_Data",0) #board.write("Enable_Record_Data",0)
#print "Enabling handshake: No-handshake" #print "Enabling handshake: No-handshake"
#board.write("HandshakeTypeW",1) #board.write("HandshakeTypeW",1)
#TriggerInterval = 400000 TriggerInterval = 400000
TriggerInterval = 0 #TriggerInterval = 0
print "Setting internal trigger interval to " , TriggerInterval print "Setting internal trigger interval to " , TriggerInterval
board.write("InternalTriggerIntervalW",TriggerInterval) #0->Internal pulse generator disabled. Any other value will generate pulses with a frequency of n*6.25ns board.write("InternalTriggerIntervalW",TriggerInterval) #0->Internal pulse generator disabled. Any other value will generate pulses with a frequency of n*6.25ns
trigInterval = board.read("InternalTriggerIntervalR") trigInterval = board.read("InternalTriggerIntervalR")
print "Trigger interval read back as ", trigInterval print "Trigger interval read back as ", trigInterval
numLoops = 500000 loopWait = 1
numLoops = 10000000
oldEvtNumber = 0 oldEvtNumber = 0
oldPreVetotriggerCount = board.read("PreVetoTriggersR")
oldPostVetotriggerCount = board.read("PostVetoTriggersR")
for iLoop in range(0,numLoops): for iLoop in range(0,numLoops):
preVetotriggerCount = board.read("PreVetoTriggersR") preVetotriggerCount = board.read("PreVetoTriggersR")
postVetotriggerCount = board.read("PostVetoTriggersR") postVetotriggerCount = board.read("PostVetoTriggersR")
preVetoFreq = (preVetotriggerCount-oldPreVetotriggerCount)/loopWait
postVetoFreq = (postVetotriggerCount-oldPostVetotriggerCount)/loopWait
print "pre , post veto triggers = " , preVetotriggerCount , postVetotriggerCount print "pre , post veto triggers = " , preVetotriggerCount , postVetotriggerCount
timestampHigh = board.read("CurrentTimestampHR") timestampHigh = board.read("CurrentTimestampHR")
timestampLow = board.read("CurrentTimestampLR") timestampLow = board.read("CurrentTimestampLR")
...@@ -183,4 +199,8 @@ for iLoop in range(0,numLoops): ...@@ -183,4 +199,8 @@ for iLoop in range(0,numLoops):
print "bufferPos, highWord , lowWord , event-number , timestamp , evtType = %x %016x %016x %08x %012x %01x" % ( evt , highWord , lowWord, evtNumber , timeStamp , evtType) print "bufferPos, highWord , lowWord , event-number , timestamp , evtType = %x %016x %016x %08x %012x %01x" % ( evt , highWord , lowWord, evtNumber , timeStamp , evtType)
time.sleep( 1.0) time.sleep( loopWait)
preVetotriggerCount = board.read("PreVetoTriggersR")
postVetotriggerCount = board.read("PostVetoTriggersR")
print "\n\nPre,post trigger count at end of run " , preVetotriggerCount , postVetotriggerCount
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment