misdoro / Electronic_load_px100

150W Electronic load / Battery discharge capacity tester PX-100 v2.70 protocol and control software. May be compatible with some DL24 versions.
GNU General Public License v3.0
108 stars 24 forks source link

Crash on parsing the time if the load is running for more than 24 hours #17

Open SY-Bisou opened 2 years ago

SY-Bisou commented 2 years ago

Hi Misdoro, i run PX100 since 1/2 year. Till now, it´s open shortly and close the program with the appended message. Any idea ? 2022-02-12_12h40_30

misdoro commented 2 years ago

:thinking: aha, it must be an issue if the load was been running for more than 24 hours...

@SY-Bisou can you try resetting the totals using the physical button on the load?

misdoro commented 2 years ago

It will be tricky to fix since the native python time is limited to 23:59:59 :facepalm:

misdoro commented 2 years ago

And the same crash occurs if the timer is set to more than 24h

SY-Bisou commented 2 years ago

thanks, i try to reset the timer

mbastida123 commented 4 months ago

Hi, I have the same problem.

My discharge test takes longer than 24h so it crashes.

One solution would be to used datetime.datetime insted of datetime.time. This would not be the best solution since we are not storing a date but a duration. Or we could simply add a %24 to this line: https://github.com/misdoro/Electronic_load_px100/blob/be917afdaf9b361c7a3b5b8457e706a63e4c65c8/instruments/px100.py#L181

Would this work?