|
@@ -350,9 +350,9 @@ def stop_dma(dma='dma0r'):
|
|
|
|
|
|
def data_reset():
|
|
|
log.info('Data reset')
|
|
|
- write_pci('000003f1', hex_mask='1')
|
|
|
+ write_pci('000003f5', hex_mask='7')
|
|
|
time.sleep(0.05)
|
|
|
- write_pci('000003f0', hex_mask='1')
|
|
|
+ write_pci('000003f0', hex_mask='7')
|
|
|
time.sleep(0.05)
|
|
|
|
|
|
|
|
@@ -379,6 +379,7 @@ def start_pilot_bunch_emulator():
|
|
|
def start_acquisition():
|
|
|
log.info('Start acquisition')
|
|
|
write_pci('1', '4', hex_mask='1')
|
|
|
+ time.sleep(0.05)
|
|
|
write_pci('00bf0', hex_mask='CF0')
|
|
|
|
|
|
|
|
@@ -409,13 +410,13 @@ def run_status(script_path):
|
|
|
|
|
|
def acquire_data(filename, duration=1.0, simulate=False):
|
|
|
#start_dma() #Dont start dma when it is already active! (Causes data corruption in the driver)
|
|
|
- #data_reset() #No Longer needed
|
|
|
|
|
|
if simulate:
|
|
|
start_pilot_bunch_emulator()
|
|
|
|
|
|
start_acquisition()
|
|
|
- time.sleep(duration)
|
|
|
+ #time.sleep(duraition) #calculate the time instead
|
|
|
+ wait_for_revolutions()
|
|
|
stop_acquisition()
|
|
|
enable_transfer()
|
|
|
write_data(filename)
|
|
@@ -426,4 +427,4 @@ def wait_for_revolutions():
|
|
|
n = read_pci(1, '0x9020', decimal=True)[0] # Get the ammount of orbits to observe
|
|
|
spin_time_ns = 368 * n
|
|
|
wait_time_s = spin_time_ns / 1000.0 / 1000.0 / 1000.0 # Milli, Micro, Nano
|
|
|
- time.sleep(wait_time_s * 1.2) # 20% Safety margin
|
|
|
+ time.sleep(wait_time_s * 1.4) # 40% Safety margin
|