Commit a47641b5 authored by Vincent Michel's avatar Vincent Michel

Add FalconX compatibility to get_raw_buffer

parent 1cae1261
......@@ -229,7 +229,16 @@ def get_raw_buffer(master, buffer_id):
data = ffi.cast('uint32_t *', array.ctypes.data)
code = handel.xiaGetRunData(master, command, data)
check_error(code)
return array[::2]
# Check magic number
if array[0] == 0:
raise RuntimeError(
"The buffer {} associated with channel {} is empty"
.format(str(buffer_id), master))
# XMAP/Mercury
if array[1] == 0:
return array[::2]
# FalconX
return array
def get_buffer_data(master, buffer_id):
......
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