WITMOTION / WitStandardProtocol_JY901

维特协议标准精度示例程序(c#)
74 stars 45 forks source link

Unable to Execute multiple iterations Data output is None on the second iteration onwards #8

Open png995 opened 4 months ago

png995 commented 4 months ago

The function readConfig fails get the required data. The dataH thread is failing to retreive the required data in the device_model.

The source code is attached here.. Fixed the thread handling for datah in the device_model.py wit_motion.zip

Modified file to run the function in multiple iterations.

WT901C485.zip

png995 commented 4 months ago

Execution details

if name == 'main':

iteration 1 is success. Able to stream the data

v_sensor = WT901C485()
print(welcome)
v_sensor.initialize_device(port="COM32")
v_sensor.start_capture_data("haptics_1.csv")
time.sleep(5)
v_sensor.stop_capture_data()
# v_sensor = None

# v_sensor_1 = WT901C485()
print(welcome)
# v_sensor_1.initialize_device(port="COM32")
time.sleep(10)
 #   iteration 2 is fail. Not able to stream the data
v_sensor.start_capture_data("haptics_2.csv")
time.sleep(5)
v_sensor.stop_capture_data()