From 124ffbda30cb12ce67627de3ac4fe2af2be4d6bc Mon Sep 17 00:00:00 2001 From: David Rice Date: Thu, 11 Dec 2025 09:57:53 +0000 Subject: [PATCH] Update with transcient test --- transient_test.py | 95 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 transient_test.py diff --git a/transient_test.py b/transient_test.py new file mode 100644 index 0000000..918d825 --- /dev/null +++ b/transient_test.py @@ -0,0 +1,95 @@ +#!/user/bin/env python3 +""" +WAY 6X Supercap Test App - way_6x_supercap_test_app.py +- ENTRY POINT OF APPLICATION + +VERSION: 1.0 + +AUTHOR: D. RICE 20/06/2024 +© 2024 FLOWBIRD TRANSPORT +""" + +# Imports +import pyvisa +import time +from threading import Timer +import sys +from datetime import datetime + +# Global variables +setup_del = 0.2 # Setup delay in seconds +meas_del = 0.05 # Measure delay in seconds +psu_on_trigger_flag = False +psu_off_trigger_flag = False +psu_on_trigger_target = 30 +psu_off_trigger_target = 10 +psu_toggle_flag = False +psu_voltage = 24.0 +psu_current = 3.0 + +VISA_ADDRESS = "TCPIP::192.168.45.3::INSTR" + +rm = pyvisa.ResourceManager() + +SPD = rm.open_resource( + VISA_ADDRESS, + write_termination='\n', + read_termination='\n' +) + +def main(): + global SPD + global setup_del + global psu_on_trigger_flag + global psu_off_trigger_flag + global psu_on_trigger_target + global psu_off_trigger_target + global psu_toggle_flag + global psu_voltage + global psu_current + + SPD.write('CH1:VOLT ' + str(psu_voltage)) # Send power supply source voltage + SPD.write('CH1:CURR ' + str(psu_current)) # Send power supply current limit + + # Enable power supply output source + SPD.write('OUTP CH1,ON') # Enable supply output + + print("TEST STARTED:- VOLTAGE: " + str(psu_voltage) + " | CURRENT: " + str(psu_current)) + print("WAITING...") + time.sleep(2) + psu_voltage = 0.0 + + for counter in range (9): + print("RAMP #" + str(counter + 1) + " | VOLTAGE: " + str(psu_voltage)) + SPD.write('CH1:VOLT ' + str(psu_voltage)) # Send power supply source voltage + #time.sleep(setup_del) + + psu_voltage = 24.0 + print("RAMP #" + str(counter + 1) + " | VOLTAGE: " + str(psu_voltage)) + SPD.write('CH1:VOLT ' + str(psu_voltage)) # Send power supply source voltage + #time.sleep(setup_del) + + psu_voltage = 0.0 + print("RAMP #" + str(counter + 1) + " | VOLTAGE: " + str(psu_voltage)) + SPD.write('CH1:VOLT ' + str(psu_voltage)) # Send power supply source voltage + time.sleep(0.25) + + psu_voltage = 24.0 + print("RAMP #" + str(counter + 1) + " | VOLTAGE: " + str(psu_voltage)) + SPD.write('CH1:VOLT ' + str(psu_voltage)) # Send power supply source voltage + + psu_voltage = 0.0 + + time.sleep(0.5) + +print("TEST FINISHED...") + +SPD.close() + + +# Run main +if __name__ == "__main__": + try: + main() + except (KeyboardInterrupt, SystemExit): + sys.exit() \ No newline at end of file