Infrastructure/Current-Stabilization/Development/GTE_Tabletop/Documentation/control
Help on module gte_control:
MODULES
matplotlib.pyplot
numpy
os
rigol
time
urllib2
DATA
home - folder where file is executing
noscp = False
IP = “http://192.168.254.2/” - ip adress of quido eth
osc_ip = ‘192.168.254.10’ - ip adress of osciloscope
sc = 1 - relay for shortcutting the condenser, defualt is shortcutted
ch = 2 - relay for charging the condenser
trig = 6 - relay for simulating trigger
cur_stab = 7 - relay for switching curent stability, defualt is no stabilization, currently unused
dch = 8 - relay for conecting condenser to discharging circuits
u_coil = 1 - osciloscope channel with coil voltage
FUNCTIONS
add_num(num, name=‘counter.txt’)
Adds 1 to num ands saves as shot number into counter file. Input: num -- int, number of previous shot name = counter.txt -- string, name of file containign countercharge(wait=2, url=‘http://192.168.254.2/’, shortcut=1, charging=2)
Charges condenser. Input: wait = 2 -- duration of charging in seconds url = IP -- ip adress of I/O module shortcut = sc -- number of relay switching shortcutting charging = ch -- number of relay switching chargingclose_all(url=‘http://192.168.254.2/’)
Switches all relays to defaul position, called 'off'. Input: url = IP -- ip adress of I/O moduledischarge(wait=0.5, stab=False, url=‘http://192.168.254.2/’, disch=8, cstab=7, delay=0.1)
Discharges condenser. Input: wait = 0.5 -- delay between opening discharging relay and shortcutting condenser stab_i = False -- toggles current stabilisation url = IP -- ip adress of I/O module disch = dch -- number of relay switching discharging thyr = th --number of relay switching thyristorget_num(name=‘counter.txt’)
Loads shot number from file. Input: name = counter.txt -- string, name of file containign counterinput_read(num, url=‘http://192.168.254.2/’)
Gets input messured on I/O module's input numbered num Input: num -- number of input url = IP -- ip adress of I/O module Output: val -- int, 1 or 0 representing logical values on or offmake_graphs(graphs, save=False)
Draws graphs from osciloskope data on selected channels specified in input graphs Input: graphs -- numbers of channels to plot save -- enables saving of ploted figuresshot(wait=0.1, chwait=2, dchwait=0.5, url=‘http://192.168.254.2/’, stab_i=False, cstab=7, graphs=[], save=False, noscope=False)
Executes Golem tokamak like shot: charges and discharges condenser. Input: wait = 0.1 -- delay between charge and discharge in seconds chwait = 2 -- duration of charging in seconds dchwait = 0.5 -- duration of discharge in seconds url = IP -- ip adress of I/O module stab_i = False -- toggles current stabilisation cstab = cur_stab -- number of relay switching current stabilisation on graphs = [] -- numbers of channels on osciloscope to be ploted save = False -- enables saving graphs to file noscope = False -- disables osciloscope Output: none or graphsswitch_off(num, url=‘http://192.168.254.2/’)
Switches off relay numbered num. Input: num -- number of relay to be switched url = IP -- ip adress of I/O moduleswitch_on(num, url=‘http://192.168.254.2/’)
Switches on relay numbered num. Input: num -- number of relay to be switched url = IP -- ip adress of I/O module
Help on module Rigol:
MODULES
- class DS1054Z from module ds1054z
FUNCTIONS
prepare_osc(scope):
Sets osciloscope to single mode. Meaning it will wait for trigger. Input: scope -- DS1054Z class - osciloscope python objectget_data(scope, channel):
Loads data from time axis and values from given oscliloscope channel. Input: scope -- DS1054Z class - osciloscope python object channel -- number of channel to read data fromsave_screen(scope, name = ‘oscope.bmp’,folder = ‘screenshots’):
Saves osciloscope screen as a name.bmp file into folder Input: scope -- DS1054Z class - osciloscope python object name = oscope.bmp -- name of screenshot folder = screenshots -- name of folder for screenshot saving
