Example #1
0
def alazar_test():
    
    AWG.set_sequence_length(0)
    seqlength = 40
    create_waveform.waitblock('waitblock_T',100,0,'yes')
    create_waveform.waitblock_marker('waitblock_marker',1000,0,'yes')
    for x in range(seqlength/2):
        create_waveform.sinwave('Sinewave%i' %x, 2000, 0.001, 1, 4.0*np.pi*x/seqlength,'yes')
        create_waveform.sinwave('Sinewave_inverse%i' %x, 2000, 0.001, 1, -4.0*np.pi*x/seqlength,'yes')
     
     
    alazar_sequence = [[] for index in range(0,seqlength)]
    for x in range(0,seqlength):
        alazar_sequence[x] = [[] for index in range(0,6)]    
        
        
    for x in range(0,seqlength,2):
        temp = x/2
        alazar_sequence[x][0] = 'no_wait'
        alazar_sequence[x][1] = 'no_loop'
        alazar_sequence[x+1][2] = 'Sinewave%i' % temp
        alazar_sequence[x+1][3] = 'Sinewave_inverse%i' % temp  
        alazar_sequence[x+1][0] = 'no_wait'
        alazar_sequence[x+1][1] = 'no_loop'
        alazar_sequence[x][2] = 'waitblock_T'
        alazar_sequence[x][3] = 'waitblock_T'  
        for y in range(4,6):
            alazar_sequence[x][y] = 'empty'
    
    alazar_sequence[0][2] = 'waitblock_marker'
    alazar_sequence[0][3] = 'waitblock_marker'    
    
    AWG.setmode('SEQUENCE') #set AWG to sequence mode
    AWG.set_sequence_length(seqlength) #create a empty sequence            
            
    for x in range(0,seqlength):
        if (alazar_sequence[x][0] == 'wait' ):
            AWG.waittrigger(x+1,1)
        else:
            AWG.waittrigger(x+1,0)
            
        if (alazar_sequence[x][1] == 'no_loop'):
            pass
        else:
            AWG.setloop(x+1,int(alazar_sequence[x][1]))
            
        for y in range(1,5):
            if (alazar_sequence[x][y] == 'empty'):
                pass
            else:
                AWG.addwaveform(x+1,y-1,alazar_sequence[x][y])      
                
    AWG.channel_on(1)
    AWG.channel_on(2)                   
Example #2
0
def alazar_test2():
    
    AWG.set_sequence_length(0)
    seqlength = 4
    create_waveform.waitblock_marker('waitblock_test',1000,0,'yes')
    create_waveform.waitblock('wait',1000,0,'yes')
    create_waveform.sinwave('Sinewave_test0' , 2048, 0.001, 1, 0,'yes')
    create_waveform.sinwave('Sinewave_test1' , 2048, 0.001, 1, 45,'yes')
    create_waveform.sinwave('Sinewave_test2', 2048, 0.001, 1, 90,'yes')
     
     
    alazar_sequence = [[] for index in range(0,seqlength)]
    for x in range(0,seqlength):
        alazar_sequence[x] = [[] for index in range(0,6)]    
        
        
    for x in range(1,seqlength):
        alazar_sequence[x][0] = 'no_wait'
        alazar_sequence[x][1] = 'no_loop'
        alazar_sequence[x][2] = 'Sinewave_test%i' %x
        alazar_sequence[x][3] = 'Sinewave_test0'  
        for y in range(4,6):
            alazar_sequence[x][y] = 'empty'
    
    alazar_sequence[0][0] = 'no_wait'
    alazar_sequence[0][1] = 'no_loop'    
    alazar_sequence[0][2] = 'waitblock_test'
    alazar_sequence[0][3] = 'waitblock_test'    

    alazar_sequence[2][0] = 'no_wait'
    alazar_sequence[2][1] = 'no_loop'    
    alazar_sequence[2][2] = 'wait'
    alazar_sequence[2][3] = 'wait'  

    alazar_sequence[3][0] = 'no_wait'
    alazar_sequence[3][1] = 'no_loop'    
    alazar_sequence[3][2] = 'Sinewave_test2'
    alazar_sequence[3][3] = 'Sinewave_test0'  
    
    AWG.setmode('SEQUENCE') #set AWG to sequence mode
    AWG.set_sequence_length(seqlength) #create a empty sequence            
            
    for x in range(0,seqlength):
        if (alazar_sequence[x][0] == 'wait' ):
            AWG.waittrigger(x+1,1)
        else:
            AWG.waittrigger(x+1,0)
            
        if (alazar_sequence[x][1] == 'no_loop'):
            pass
        else:
            AWG.setloop(x+1,int(alazar_sequence[x][1]))
            
        for y in range(1,5):
            if (alazar_sequence[x][y] == 'empty'):
                pass
            else:
                AWG.addwaveform(x+1,y-1,alazar_sequence[x][y])                             
                
            
    AWG.channel_on(1)
    AWG.channel_on(2)