Skip to content
Snippets Groups Projects
Select Git revision
  • d9ac2cd05f98d0eafa2650d25be153f464c009f7
  • main default protected
  • feature/VA-100_Modbus_RTU
  • develop
  • stepperControl
5 results

get_variable_names.vi

Blame
  • main.py 3.39 KiB
    import sys
    sys.path.insert(0, './lib')
    sys.path.insert(0, '..') #append parent directory
    
    from interface import *
    import hp4155a
    
    first_page = page_1()
    second_page = page_2()
    third_page = page_3()
    fourth_page = page_4()
    fifth_page = page_5()
    
    titles = ["SMUs","User Functions","Parameters","Plotting","Save to file"]
    children = [first_page,second_page,third_page,fourth_page,fifth_page]
    tab = widgets.Tab()
    tab.children = children
    tab.titles = titles
    
    display(tab)
    
    start = widgets.Button(description='Start Measurement')
    output = widgets.Output()
    
    display(start,output)
    
    #device = hp4155a.HP4155a('GPIB0::17::INSTR')
    
    def on_start_clicked(b):
        with output:
            change_state(first_page,second_page,third_page,fourth_page,fifth_page)
            # Step 1 create the dictionaries
            
            #first page
            smus = []
            #iterate over the rows
            for i in range(1,5):
                smus.append(create_dict(vname = first_page[i,1].value,iname=first_page[i,2].value,mode = first_page[i,3].value,func = first_page[i,4].value,disabled=first_page[i,5].value))
            
           
            # second page
            user_functions = []
            #iterate over the rows
            for i in range(1,7):
                user_functions.append(create_dict(name = second_page[i,0].value,unit=second_page[i,1].value,expression = second_page[i,2].value))
    
            # third_page
            measurement_mode = third_page[0,0].value
            integration = third_page[0,1].value
            stress_duration = third_page[0,2].value
    
            #match hysteris checkbox with the command forwarded to the tool
            if third_page[9,0].value == True:
                hyst = 'DOUB'
            else:
                hyst = 'SING'
    
            var1 = create_dict(start = third_page[4,0].value, stop = third_page[5,0].value,step = third_page[6,0].value,comp = third_page[7,0].value,pcomp =third_page[8,0].value,mode = hyst)
            var2 = create_dict(start = third_page[4,1].value,stop = third_page[5,1].value,points = third_page[6,1].value,comp = third_page[7,1].value,pcomp=third_page[8,1])
            vard = create_dict(offset=third_page[4,2].value,ratio = third_page[5,2].value,comp = third_page[7,2].value,pcomp=third_page[8,2].value)
            pulse = create_dict(period=third_page[4,3].value,width = third_page[5,3].value,base = third_page[6,3].value)
    
    
            #sampling and stress parameters
            parameters= create_dict(mode=third_page[12,0].value,interval=third_page[13,0].value,hold=third_page[16,0].value,points=third_page[14,0].value,filter=third_page[17,0].value)
            duration = third_page[13,0].value
    
            # Constant Smus
            cons_smus = []
            for j in range(1,5):
                cons_smus.append(create_dict(value = third_page[21,j].value,comp=third_page[22,j].value))
    
            # Page 4
            axes = [] # 0 is x-axis , 1 is y1-axis and 2 is y2-axis
            for j in range(1,4): #iterate over the column
                axes.append(create_dict(name = fourth_page[1,j].value,scale = fourth_page[2,j].value,min =fourth_page[3,j].value,max = fourth_page[4,j].value))
    
            # Page 5
            measurement_name = fifth_page[0,0].value
            processing_nr = fifth_page[1,0].value
            sample_series = fifth_page[2,0].value
            dut = fifth_page[3,0].value
            
            variables = []
            for i in range(8):
                variables.append(create_dict(name =  fifth_page[6+i,0].value,unit =fifth_page[6+i,1].value))
    
    
    
    
            
    start.on_click(on_start_clicked)