Example Code

Arbitrary Waveform Generation - Phase Shifting On-the-Fly

Code and Documents

Attachment

Overview

Allows to synchronize two arbitrary waveform generators with a constant phase shift

 

Description

This example synchronizes two arbitrary waveform generators, using one output as a constant phase reference.  The second output can have its phase shifted while the arbitrary waveform generator is running by taking advantage of scripting. The phase shifting device stores two waveforms in its memory, clocking out only one at a time.  The unused waveform can have its sample points updated with a phase-shift signal and then a script trigger causes the device to switch to the updated waveform.

 

Requirements
Software:
  Labview 2012 (or compatible)
  NI-Fgen driver which is compatible with your hardware and version of LabVIEW
Hardware:
  NI Fgen device

 

Steps to Implement or Execute Code

1. Select the name of your Fgen devices
2. Configure the Fgen session
3. Run the VI

 

Additional Information or References

Block Diagram

145.png

*Please Note*

The master device and slave device may experience a delay between when their respective outputs start generation (caused by trigger delay), causing an initial phase offset.  This can be mitigated by using a third device, such as a digital I/O card, Multifunction DAQ device, or timing card to generate a start trigger across the PXI backplane (star line recommended).  Alternatively, one can use TCLK to better synchronize the start of the devices' outputs without an external trigger source, but this prevents script triggers from being used, which are required to implement phase shift on the fly.

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,
Chris Elliott
x36772

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.