Streaming is a way to generate waveforms that are too large to fit in the onboard memory of an RF signal generator.

Streaming can be used in Arbitrary Waveform or Script generation modes.

To stream waveform data, allocate and identify all or a portion of the RF signal generator onboard memory to act as an onboard waveform for streaming. Before initiating waveform generation, fill that onboard memory with the first part of your waveform. As the waveform is generated, continuously write the remaining waveform data until generation is complete. The RF signal generator uses the instrument to stream the waveform.

Streaming Waveform Data

The following instructions are a guide for configuring your application for streaming.

As an example, we have a 1.6 GB waveform we want to generate and an NI arbitrary waveform generator with 256 MB of onboard memory. This 1.6 GB waveform may be in the host memory, on disk, or data that your application generates dynamically during generation.

  1. Identify the streaming waveform—Set the Streaming Waveform Name property. Setting this property ensures that none of your streaming data is overwritten before it is generated. DSTG monitors your progress to ensure that you write fresh data fast enough to keep up with the generation. If your application fails to keep up or attempts to write fresh data over data that has not been generated, DSTG returns an error.

  2. Specify the amount of onboard memory to be used for streaming—Call DSTG Allocate Arb Waveform to specify the amount of onboard memory to reserve for streaming. The allocated memory, known as the streaming waveform, serves as a buffer for the streaming process. The size of the waveform you wish to stream must be evenly divisible by the amount of onboard memory allocated for streaming to prevent the streaming waveform from being overwritten before it has generated.

  3. Fill the streaming waveform with initial data—Call DSTG Write Arb Waveform to write the first part of the waveform data to the streaming waveform in onboard memory.
    Tip When transferring large blocks of waveform data, break the data into smaller blocks and call the DSTG Write Arb Waveform multiple times. The data is appended sequentially. A computer can allocate smaller blocks of a large waveform faster than allocating a single large contiguous block in memory. Depending on the amount of RAM on the computer, transferring ten 16 MB blocks may be faster than transferring one 160 MB block.


  4. Begin generating the waveform—Call DSTG Initiate to begin the waveform generation. As the waveform generates, space in the streaming waveform becomes free.

  5. (Optional) Monitor available memory as the waveform generates—Use the Space Available in Streaming Waveform (Samples) property to determine how much of the streaming waveform is free for writing new data. As the waveform generates, space becomes available to write more waveform data.

  6. Write a block of waveform data—Call DSTG Write Arb Waveform to write a new block of waveform data to the streaming waveform in onboard memory.

    If the size of the new block of waveform data is larger than the space available, DSTG waits until sufficient space becomes available or the streaming write time expires. Use the Streaming Write Timeout property to change the streaming write time.



  7. Repeat steps 5 and 6 until all waveform data is written.

Improving Streaming Performance

To improve your maximum sustainable transfer rate for streaming, consider the following recommendations:

  • When streaming from hard drives, consider the hard drive speed for maximum sustainable rates. Laptop hard drives typically have a data transfer rate of 25 MB/s to 30 MB/s. Desktop hard drives often can meet 55 MB/s to 70 MB/s. Transfer rates from hard drives can vary for a number of reasons, including where the data is physically stored on the hard drive and how much data is stored. Storing your waveform files on a fairly empty, defragmented hard drive may help increase performance.
  • Consider using Solid-state drives (SSD) can also improve performance with speeds up to 3500 MB/s.
  • Consider using a redundant array of independent disks (RAID) configuration to utilize striping to increase data transfer rates from disk.