Hi,I have completed a first pass zketech-ebd-usb test script and provided the output evidence showing it working.
The USB load tester was connected to my PC USB port, so this shows that this PC port can provide 0.5A. The port was connected via a long 1.5m USB extender cable and may account for some of the V drop in the output. My excitement is that it works.
Looking forward to seeing if someone can provide the QC2/QC3 extensions and then I can expand the automated testing capabilities to QC2/QC3 chargers.
As previously - I am happy for the header to be modified to be included into the sigrok repo.
Regards Stuart
# smuview test code for zketech-ebd-usb device # # test code written by: Stuart Tyler # licence: free - do what you want - no responcibility from supply side # tested by: Stuart Tyler # tested on device: ske-edb-usb # Objective: Show that the load can be communicated with and controlled in python # 1. Connect to the load and show its capabilities # 2. Show the load voltage and current # 3. Change the load current # 4. TO DO: Change the load voltage using QC2 protocol (driver needs to be updated to be able to do this) import smuview import time print("------START OF zketech-ebd-usb TEST------") print("------CURRENT SESSION INFORMATION------") current_devices = Session.devices() print(current_devices) print("------CONNECT DEVIDE TO SESSION------") # Connect device. # Edit the connection point below to the location needed on your setup dev = Session.connect_device("zketech-ebd-usb:conn=COM3")[0] print (dev) print("------SHOW CONFIGURABLES------") conf = dev.configurables()[""] print (conf) # Sleep 1s to give the devices the chance to create signals. # As per sample code from other demos time.sleep(1) print("------SHOW CHANNELS------") channels = dev.channels() print(channels) print("------SHOW LISTABLE CONFIGS------") listconf=conf.listable_configs() print(listconf) print("------SHOW SETABLE CONFIGS------") settable=conf.setable_configs() print(settable) print("------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------") for x in range(10): # Get last sample from channel V. sample = dev.channels()["V"].actual_signal().get_last_sample(True) print("V= ", sample) sample = dev.channels()["I"].actual_signal().get_last_sample(True) print("I= ", sample) time.sleep(1) print("------ATTEMPT TO TURN LOAD OUTPUT TO 0.2A------") conf.set_config(smuview.ConfigKey.CurrentLimit, 0.2) print("------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------") for x in range(10): # Get last sample from channel V. sample = dev.channels()["V"].actual_signal().get_last_sample(True) print("V= ", sample) sample = dev.channels()["I"].actual_signal().get_last_sample(True) print("I= ", sample) time.sleep(1) print("------ATTEMPT TO TURN LOAD OUTPUT TO 0.5A------") conf.set_config(smuview.ConfigKey.CurrentLimit, 0.5) print("------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------") for x in range(10): # Get last sample from channel V. sample = dev.channels()["V"].actual_signal().get_last_sample(True) print("V= ", sample) sample = dev.channels()["I"].actual_signal().get_last_sample(True) print("I= ", sample) time.sleep(1) print("------ATTEMPT TO TURN LOAD OUTPUT TO 0.0A------") conf.set_config(smuview.ConfigKey.CurrentLimit, 0.0) print("------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------") for x in range(10): # Get last sample from channel V. sample = dev.channels()["V"].actual_signal().get_last_sample(True) print("V= ", sample) sample = dev.channels()["I"].actual_signal().get_last_sample(True) print("I= ", sample) time.sleep(1) print("------END OF zketech-ebd-usb TEST------")
------START OF zketech-ebd-usb TEST------ ------CURRENT SESSION INFORMATION------ {} ------CONNECT DEVIDE TO SESSION------ <smuview.HardwareDevice object at 0x000000000931A5A8> ------SHOW CONFIGURABLES------ <smuview.Configurable object at 0x000000000931A9D0> ------SHOW CHANNELS------ {'Ah': <smuview.BaseChannel object at 0x00000000097B8730>, 'P': <smuview.BaseChannel object at 0x00000000097B8D50>, 'R': <smuview.BaseChannel object at 0x00000000097B8D88>, 'I': <smuview.HardwareChannel object at 0x00000000097B8D18>, 'Wh': <smuview.BaseChannel object at 0x00000000097B8E30>, 'V': <smuview.HardwareChannel object at 0x00000000097B8DC0>} ------SHOW LISTABLE CONFIGS------ {<ConfigKey.CurrentLimit: 32>} ------SHOW SETABLE CONFIGS------ {<ConfigKey.CurrentLimit: 32>} ------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------ V= (108.95600008964539, 4.978000164031982) I= (108.95600008964539, 0.0) V= (110.53800010681152, 4.9770002365112305) I= (110.53800010681152, 0.0) V= (110.53800010681152, 4.9770002365112305) I= (110.53800010681152, 0.0) V= (112.54299998283386, 4.9770002365112305) I= (112.54299998283386, 0.0) V= (112.54299998283386, 4.9770002365112305) I= (112.54299998283386, 0.0) V= (114.54800009727478, 4.978000164031982) I= (114.54800009727478, 0.0) V= (114.54800009727478, 4.978000164031982) I= (114.54800009727478, 0.0) V= (116.55400013923645, 4.978000164031982) I= (116.55400013923645, 0.0) V= (116.55400013923645, 4.978000164031982) I= (116.55400013923645, 0.0) V= (118.55800008773804, 4.978000164031982) I= (118.55800008773804, 0.0) ------ATTEMPT TO TURN LOAD OUTPUT TO 0.2A------ ------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------ V= (118.55800008773804, 4.978000164031982) I= (118.55800008773804, 0.0) V= (120.00999999046326, 4.978000164031982) I= (120.00999999046326, 0.0) V= (121.56500005722046, 4.734000205993652) I= (121.56500005722046, 0.2004999965429306) V= (121.56500005722046, 4.734000205993652) I= (121.56500005722046, 0.2004999965429306) V= (123.57000017166138, 4.769999980926514) I= (123.57000017166138, 0.2004999965429306) V= (123.57000017166138, 4.769999980926514) I= (123.57000017166138, 0.2004999965429306) V= (125.57400012016296, 4.804999828338623) I= (125.57400012016296, 0.2004999965429306) V= (125.57400012016296, 4.804999828338623) I= (125.57400012016296, 0.2004999965429306) V= (127.58000016212463, 4.808000087738037) I= (127.58000016212463, 0.2004999965429306) V= (127.58000016212463, 4.808000087738037) I= (127.58000016212463, 0.2004999965429306) ------ATTEMPT TO TURN LOAD OUTPUT TO 0.5A------ ------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------ V= (129.58400011062622, 4.809000015258789) I= (129.58400011062622, 0.2004999965429306) V= (129.58400011062622, 4.809000015258789) I= (129.58400011062622, 0.2004999965429306) V= (131.58899998664856, 4.663000106811523) I= (131.58899998664856, 0.5004000067710876) V= (131.58899998664856, 4.663000106811523) I= (131.58899998664856, 0.5004000067710876) V= (133.59400010108948, 4.682000160217285) I= (133.59400010108948, 0.5004000067710876) V= (133.59400010108948, 4.682000160217285) I= (133.59400010108948, 0.5004000067710876) V= (135.59800004959106, 4.666999816894531) I= (135.59800004959106, 0.5004000067710876) V= (135.59800004959106, 4.666999816894531) I= (135.59800004959106, 0.5004000067710876) V= (137.60199999809265, 4.675000190734863) I= (137.60199999809265, 0.5004000067710876) V= (137.60199999809265, 4.675000190734863) I= (137.60199999809265, 0.5004000067710876) ------ATTEMPT TO TURN LOAD OUTPUT TO 0.0A------ ------ATTEMPT TO READ LOAD OUTPUT VOLTAGE AND CURRENT 10 TIMES 1 SECOND DELAY------ V= (139.60700011253357, 4.679999828338623) I= (139.60700011253357, 0.5004000067710876) V= (140.17300009727478, 4.679999828338623) I= (140.17300009727478, 0.5004000067710876) V= (141.6100001335144, 5.051000118255615) I= (141.6100001335144, 0.0) V= (141.6100001335144, 5.051000118255615) I= (141.6100001335144, 0.0) V= (143.614000082016, 5.0229997634887695) I= (143.614000082016, 0.0) V= (143.614000082016, 5.0229997634887695) I= (143.614000082016, 0.0) V= (145.61899995803833, 5.0229997634887695) I= (145.61899995803833, 0.0) V= (145.61899995803833, 5.0229997634887695) I= (145.61899995803833, 0.0) V= (145.61899995803833, 5.0229997634887695) I= (145.61899995803833, 0.0) V= (145.61899995803833, 5.0229997634887695) I= (145.61899995803833, 0.0) ------END OF zketech-ebd-usb TEST------
_______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel