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"?>
<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>
......@@ -105,6 +105,12 @@ print " Count 3 = " , count3
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"
board.write("DUTMaskW",3)
DUTMask = board.read("DUTMaskR")
......@@ -112,6 +118,8 @@ print "DUTMaskR = " , DUTMask
print "Ignore veto from shutter"
board.write("IgnoreShutterVetoW",1)
#print "Listen for veto from shutter"
#board.write("IgnoreShutterVetoW",0)
IgnoreShutterVeto = board.read("IgnoreShutterVetoR")
print "IgnoreShutterVeto = " , IgnoreShutterVeto
......@@ -128,30 +136,38 @@ board.write("EventFifoCSR",0x2)
eventFifoFillLevel = board.read("EventFifoFillLevel")
print "FIFO fill level after resetting FIFO = " , eventFifoFillLevel
#print "Enabling data recording"
#board.write("Enable_Record_Data",1)
print "Disabling data recording"
board.write("Enable_Record_Data",0)
print "Enabling data recording"
board.write("Enable_Record_Data",1)
#print "Disabling data recording"
#board.write("Enable_Record_Data",0)
#print "Enabling handshake: No-handshake"
#board.write("HandshakeTypeW",1)
#TriggerInterval = 400000
TriggerInterval = 0
TriggerInterval = 400000
#TriggerInterval = 0
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
trigInterval = board.read("InternalTriggerIntervalR")
print "Trigger interval read back as ", trigInterval
numLoops = 500000
loopWait = 1
numLoops = 10000000
oldEvtNumber = 0
oldPreVetotriggerCount = board.read("PreVetoTriggersR")
oldPostVetotriggerCount = board.read("PostVetoTriggersR")
for iLoop in range(0,numLoops):
preVetotriggerCount = board.read("PreVetoTriggersR")
postVetotriggerCount = board.read("PostVetoTriggersR")
preVetoFreq = (preVetotriggerCount-oldPreVetotriggerCount)/loopWait
postVetoFreq = (postVetotriggerCount-oldPostVetotriggerCount)/loopWait
print "pre , post veto triggers = " , preVetotriggerCount , postVetotriggerCount
timestampHigh = board.read("CurrentTimestampHR")
timestampLow = board.read("CurrentTimestampLR")
......@@ -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)
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