PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
class PCIO_STREAMING_DATA_INFO(ctypes.Structure):
_pack_ = 1 # for byte alignment
_fields_ = [
("channel_", ctypes.c_int32),
("mode_", ctypes.c_int32),
("type_", ctypes.c_int32),
("noOfSamples_", ctypes.c_int32),
("bufferIndex_", ctypes.c_uint64),
("startIndex_", ctypes.c_int32),
("overflow_", ctypes.c_int16),
]
class PCIO_STREAMING_DATA_TRIGGER_INFO(ctypes.Structure):
_pack_ = 1 # for byte alignment
_fields_ = [
("triggerAt_", ctypes.c_uint64),
("triggered_", ctypes.c_int16),
("autoStop_", ctypes.c_int16),
]
...
# get blocks
streaming_data_info_arr_type = ctypes.POINTER(PCIO_STREAMING_DATA_INFO) * len(chNums)
streaming_data_info_arr = streaming_data_info_arr_type()
for idx, chNum in enumerate(chNums):
one = PCIO_STREAMING_DATA_INFO(
chNum,
ps.PSOSPA_RATIO_MODE["PICO_RATIO_MODE_RAW"],
dataType,
0,
0,
0,
0,
)
streaming_data_info_arr[idx] = ctypes.pointer(one)
streaming_data_info_arr_ptr = ctypes.byref(streaming_data_info_arr)
streaming_data_trigger_info = PCIO_STREAMING_DATA_TRIGGER_INFO(0, 0, 0)
streaming_data_trigger_info_ptr = ctypes.byref(streaming_data_trigger_info)
status = ps.psospaGetStreamingLatestValues(
unit, streaming_data_info_arr_ptr, len(chNums), streaming_data_trigger_info_ptr
)