@@ -162,11 +162,6 @@ def _error_handler(self, status: int) -> None:
162162 # raise an exception as callers may poll until data is ready.
163163 if status == 407 : # PICO_WAITING_FOR_DATA_BUFFERS
164164 return
165- # Streaming related status codes indicate no new data is ready.
166- # These should not be treated as fatal errors and simply signal
167- # the caller to try again later.
168- if status in [28672 , 28673 , 28674 ]:
169- return
170165 self .close_unit ()
171166 raise PicoSDKException (error_code )
172167 return
@@ -716,8 +711,8 @@ def get_values_bulk_async(
716711 to_segment_index : int ,
717712 down_sample_ratio : int ,
718713 down_sample_ratio_mode : int ,
719- lp_data_ready ,
720- p_parameter ,
714+ lp_data_ready : ctypes . POINTER ,
715+ p_parameter : ctypes . POINTER ,
721716 ) -> None :
722717 """Begin asynchronous retrieval of values from multiple segments.
723718
@@ -1863,8 +1858,8 @@ def run_streaming(
18631858 self .handle ,
18641859 ctypes .byref (c_sample_interval ),
18651860 time_units ,
1866- max_pre_trigger_samples ,
1867- max_post_trigger_samples ,
1861+ int ( max_pre_trigger_samples ) ,
1862+ int ( max_post_trigger_samples ) ,
18681863 auto_stop ,
18691864 ratio ,
18701865 ratio_mode ,
@@ -1928,6 +1923,36 @@ def get_values(self, samples, start_index=0, segment=0, ratio=0, ratio_mode=RATI
19281923 self .is_over_range ()
19291924 return total_samples .value
19301925
1926+ def get_streaming_latest_values (
1927+ self ,
1928+ channel ,
1929+ ratio_mode ,
1930+ data_type
1931+ ):
1932+ info = PICO_STREAMING_DATA_INFO (
1933+ channel_ = channel ,
1934+ mode_ = ratio_mode ,
1935+ type_ = data_type ,
1936+ )
1937+ trigger = PICO_STREAMING_DATA_TRIGGER_INFO ()
1938+
1939+ status = self ._call_attr_function (
1940+ "GetStreamingLatestValues" ,
1941+ self .handle ,
1942+ ctypes .byref (info ),
1943+ 1 ,
1944+ ctypes .byref (trigger )
1945+ )
1946+ return {
1947+ 'status' : status ,
1948+ 'no of samples' : info .noOfSamples_ ,
1949+ 'Buffer index' : info .bufferIndex_ ,
1950+ 'start index' : info .startIndex_ ,
1951+ 'overflowed?' : info .overflow_ ,
1952+ 'triggered at' : trigger .triggerAt_ ,
1953+ 'triggered?' : trigger .triggered_ ,
1954+ 'auto stopped?' : trigger .autoStop_ ,
1955+ }
19311956
19321957 def is_over_range (self ) -> list :
19331958 """
0 commit comments