Skip to content
Snippets Groups Projects
Commit 555b1797 authored by Patrick Robbe's avatar Patrick Robbe
Browse files

Adapt script for KEK test bench

parent 9a7b3f8d
No related branches found
No related tags found
No related merge requests found
......@@ -54,26 +54,31 @@ def _crc16(data, crc, table):
crc = ((crc<<8)&0xff00) ^ table[((crc>>8)&0xff)^byte1]
return crc & 0xffff
import socket
hname = socket.gethostname()
for nev in range( 10 ):
# Send trigger (adapt this line to your system)
os.system( "ssh vme \"trigft -80 pulse 1 1\"" ) ### ADD this to suppress output >/dev/null 2>&1" )
if ( hname == 'belle2daq.local' ):
os.system( "ssh vme \"trigft -80 pulse 1 1\"" ) ### ADD this to suppress output >/dev/null 2>&1" )
else: ### KEK
os.system( "ssh ttd3 \"trigft -23 pulse 1 1\"" )
# wait for data to arrive
attempt = 0
size = 0
while size != 892:
status, val = mem.read( 0 , 0x00050080)
size = val
attempt = attempt + 1
if attempt > 1000:
for i in range( 10000 ):
mem.read( 0 , 0x00050060 )
print 'Error in reading: try again now'
exit( 0 )
## temporisation of 2s
import time
time.sleep( 2 )
status, val = mem.read( 0 , 0x00050080)
size = val
print "Number of words received = {}".format( size )
if size == 0:
print 'Not enough data read, exit'
exit( 0 )
# read data
data = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment