# How to remotely synchronise two waveforms ?

Question asked by surbhij on Jun 11, 2018
Latest reply on Jun 25, 2018 by jonathan.falco

Hi,

I am trying to bring two sine waves at 0 phase using remote interface option by coding in python. The two signal generators are 33220.As i understood - there are two ways of doing it, either by continous wave mode or burst mode.

I tried to implement code for both but it does not seem to work.

The code  is below, the function set - sends the wave for set freq and voltage, the fucntion synchro_burst sends the commands for burst synch and similarly for continous wave sync.

The commands intitate the corresponding buttons on the generator, but still phase between is not zero.

I will be highly grateful for any advice.

Thank you

Regards,

----------------------------------------------------------------------------------------------------------------------------------------------------------

def set (self, freqHz, Vrms, phase):
print "%sHz\t\t%0.02fVrms = %0.02fVpp\t\t%sdeg"%(freqHz, Vrms, 2*Vrms/math.sqrt(2), phase)
self.dev.write ("APPL:SIN %.04f HZ, %.04f VPP, 0 V"%(freqHz,2*Vrms/math.sqrt(2)))

----------------------------------------------------------------------------------------------------------------------------------------------------------

def synchro_burst (self,type):

if(type == "master"):

print"configuring master"

print "BUSRT ON"
self.dev.write("BURS:STAT ON")

print "INF CYC ON"
self.dev.write("BURS:NCYC INF")

print "SLOP POS ON"
self.dev.write("OUT:TRIG:SLOP POS")

self.dev.write("OUT:TRIG ON")

elif(type == "slave"):
print"configuring slave"

print "BUSRT ON"
self.dev.write("BURS:STAT ON")

print "INF CYC ON"
self.dev.write("BURS:NCYC INF")

print "TRIG EXT"
self.dev.write("TRIG:SOUR EXT")

print "SLOP POS ON"
self.dev.write("TRIG:SLOP POS")

----------------------------------------------------------------------------------------------------------------------------------------------------------

def cw_sync(self,type):
if(type == "slave"):
offset = self.dev.write("PHAS?")[0]
self.dev.write ("PHAS:REF")

----------------------------------------------------------------------------------------------------------------------------------------------------------