Streaming Waveform Data

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

The following instructions are a guide for configuring your application for streaming. For a programmatic example, refer to RFSG Arbitrary Waveform Streaming.vi for LabVIEW or ArbitraryWaveformStreaming.prj for LabWindows/CVI, available using the NI Example Finder.

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. NI-RFSG 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, NI-RFSG returns an error.

  2. Specify the amount of onboard memory to be used for streaming—Call NI-RFSGAllocate 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 NI-RFSGWrite 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 NI-RFSGWrite 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 NI-RFSGInitiate 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 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 NI-RFSGWrite 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, NI-RFSG 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.