Jump to content
  • 0

Synchronize 2 Outputs on Analog Discovery 2


cfatt7

Question

Hi,

 

I am trying to synchronize two sine waves referring to the sample file "analogout_sync.cpp" using the master and slave technique, but I feel like there is too much of a delay before the second wave is generated still. When I use an external oscilloscope, it shows that the sine waves are not in sync and the phases change for the waves every time the program is rerun, so I can't hardcode a phase to fix it. Is there any way to make sure I can sync the two waves using C++ code?

Thanks

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hi @cfatt7

Yes, you can use the FDwfAnalogOutConfigure(..., -1, ...) to start channels synchronized.

You can also use the FDwfAnalogOutMasterSet to specify the master channel, then starting master channel will also start the slave channels. This is important in case you are using external triggering or cross-triggering with other instruments.

Specifying a finite run length is useful to keep different frequencies phase aligned, using the minimum frequency or greatest common divisor.
Like 1kHz might be generate as 0.9999999kHz and 2kHz as 2.000000001kHz, which could shift slowly over time. In this case use 1ms (1/1kHz) run time.

FDwfAnalogOutRunSet(..., ..., 1.0/min_freq); FDwfAnalogOutRepeatSet(..., ..., 0);

See the WF SDK/ samples/ py/ AnalogOut_Sync.py examples

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...