Esempio n. 1
0
temp = {}
temp['103_State']=5
temp['118_SOC']=50
ctr=0
Prev_Vac=230

#while temp['103_State'] !=10:
    
for step in steps:
    stp_ctr=0
    while stp_ctr<10:  
        #if temp['103_State']==5:# and temp['118_SOC']>90:# or temp['103_State']!=3:
            #Pac=-Pac
            #time.sleep(2)
        #print step
        pac_set(float32_to_msb(load[step]),float32_to_lsb(load[step]),client)
        #pac_set(float32_to_msb(Pac),float32_to_lsb(Pac),client)
                
        #measure()
        measured = False
        while not measured:
            try:
                #print('measure')
                measure()
                measured = True
            except:
                pass      
    
        if (temp['109_Vac_Grid_L2L']-Prev_Vac)>10:
            stp_ctr=stp_ctr+1
            print stp_ctr
Esempio n. 2
0
temp['103_State'] = 5
temp['118_SOC'] = 50
ctr = 0
Pac = 1500
Prev_Vac = 230
stp_ctr = 0
scope.write('ACQ:STATE ON')
time.sleep(5)

#while temp['103_State'] !=10:# or stp_ctr!=10):
while temp['118_SOC'] > 5:

    if temp['103_State'] == 5:  # and temp['118_SOC']>90:# or temp['103_State']!=3:
        #Pac=-Pac
        #time.sleep(2)
        pac_set(float32_to_msb(Pac), float32_to_lsb(Pac), client)
        #pac_set(float32_to_msb(Pac),float32_to_lsb(Pac),client)

    #elif temp['103_State']==5 and temp['118_SOC']<90:
    #    time.sleep(2)
    #    pac_set(float32_to_msb(Pac),float32_to_lsb(Pac),client)

    #measure()
    measured = False
    while not measured:
        try:
            #print('measure')
            measure()
            measured = True
        except:
            pass