I am writing a custom GUI to send and monitor pulses. One system sends a constant background pulse (black) to one piece of hardware, meanwhile the user specify inputs for the pulses for the other systems. When a button is pressed, the configurations are set up and the device is set to wait for a trigger to begin generating the analog pulses. However, I get a single first pulse from the analog waveform generators (blue&red) when the configuration button is clicked, before the PC trigger line pulse is sent. How do I eliminate these initial configuration pulses?
This is the code for the configuration. When this method is called I get the single analog pulse outputs. Everything works properly after that ie- the analog pulses start on the correct trigger signal.
def ArmTrigger(self):
# analog pulse control setup
self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_int(True))
self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_int(True))
self.dwf.FDwfAnalogOutMasterSet(hdwf, c_int(1), c_int(0)); # for second channel set master the first channel, slave channel is controlled by the master
self.dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(-1), AnalogOutNodeCarrier, funcSquare)
self.dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(self.xRate))
self.dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(1))
self.dwf.FDwfAnalogOutOffsetSet(hdwf, c_int(-1), c_double(0))
self.dwf.FDwfAnalogOutNodeSymmetrySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(symm)) #pulse width
self.dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_double(self.x2Phase)) #phase shift for second channel
self.dwf.FDwfAnalogOutRunSet(hdwf, c_int(-1), c_double(self.xDuration)) #set run duration on all channels
self.dwf.FDwfAnalogOutIdleSet(hdwf,c_int(-1), c_int(0))
#set up PC trigger to start pulse output AND acquisition
self.dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), trigsrcPC)
self.dwf.FDwfAnalogOutTriggerSlopeSet(hdwf, c_int(0), c_int(0)) # set master channel to trigger on rising edge
#configure everything to wait for trigger
self.dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) # start master, slave will follow
self.StartButton.setEnabled(True) #start button click sends trigger line pulse with dwf.FDwfDeviceTriggerPC(hdwf)
Question
spri
I am writing a custom GUI to send and monitor pulses. One system sends a constant background pulse (black) to one piece of hardware, meanwhile the user specify inputs for the pulses for the other systems. When a button is pressed, the configurations are set up and the device is set to wait for a trigger to begin generating the analog pulses. However, I get a single first pulse from the analog waveform generators (blue&red) when the configuration button is clicked, before the PC trigger line pulse is sent. How do I eliminate these initial configuration pulses?
This is the code for the configuration. When this method is called I get the single analog pulse outputs. Everything works properly after that ie- the analog pulses start on the correct trigger signal.
def ArmTrigger(self):
# analog pulse control setup
self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_int(True))
self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_int(True))
self.dwf.FDwfAnalogOutMasterSet(hdwf, c_int(1), c_int(0)); # for second channel set master the first channel, slave channel is controlled by the master
self.dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(-1), AnalogOutNodeCarrier, funcSquare)
self.dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(self.xRate))
self.dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(1))
self.dwf.FDwfAnalogOutOffsetSet(hdwf, c_int(-1), c_double(0))
self.dwf.FDwfAnalogOutNodeSymmetrySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(symm)) #pulse width
self.dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_double(self.x2Phase)) #phase shift for second channel
self.dwf.FDwfAnalogOutRunSet(hdwf, c_int(-1), c_double(self.xDuration)) #set run duration on all channels
self.dwf.FDwfAnalogOutIdleSet(hdwf,c_int(-1), c_int(0))
#set up PC trigger to start pulse output AND acquisition
self.dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), trigsrcPC)
self.dwf.FDwfAnalogOutTriggerSlopeSet(hdwf, c_int(0), c_int(0)) # set master channel to trigger on rising edge
#configure everything to wait for trigger
self.dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) # start master, slave will follow
self.StartButton.setEnabled(True) #start button click sends trigger line pulse with dwf.FDwfDeviceTriggerPC(hdwf)
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.