# import platform import time as t import numpy as np import globals as g import cage_func as func from pyps2000b import PS2000B # User Inputs/Configuration---------------------------------- Test1 = 0 Test2 = 0 Test3 = 0 Test4 = 0 # Constants: g.Coil_const = np.array([38.6, 38.45, 37.9])*1e-9 # Coil constants [x,y,z] in T/A g.ambientField = np.array([80])*1e-6 # ambient magnetic field in measurement area, to be cancelled out # COM-Ports for power supply units: xPort = "COM7" # placeholder g.xDevice = PS2000B.PS2000B(xPort) func.print_status(g.xDevice) t.sleep(3) g.xDevice.enable_all() func.print_status(g.xDevice) t.sleep(3) if Test1 == 1: g.xDevice.voltage1 = 5 t.sleep(1) func.print_status(g.xDevice) t.sleep(5) func.set_to_zero(g.xDevice) if Test2 == 1: g.xDevice.current1 = 0.2 t.sleep(1) func.print_status(g.xDevice) t.sleep(5) func.set_to_zero(g.xDevice) if Test4 == 1: func.set_axis_current(g.xDevice, 0.2) t.sleep(1) func.print_status(g.xDevice) t.sleep(10) func.set_to_zero(g.xDevice) t.sleep(1) func.print_status(g.xDevice) g.xDevice.disable_all() func.print_status(g.xDevice)