Streaming External Data to a TDMS File (Windows)

The following figure illustrates guidelines for using the TDMS Advanced Data Reference I/O functions to stream external data to a .tdms file.

The following events occur in the previous figure:

The TDMS Advanced Open function opens a .tdms file for the write operation and returns a reference to the .tdms file. If the specified file does not exist, this function creates the file.
The TDMS Set Channel Information function specifies the channel information for the data you want to write to the .tdms file. The channel information includes channel names, the data type, and the number of data samples in each channel.
The TDMS Configure Asynchronous Writes (Data Ref) function specifies that LabVIEW can run eight asynchronous writes at most in the background. You must use this function to configure the asynchronous writes before streaming the external data. Errors occur if you do not include this function in your data-streaming application.
(Recommended) The TDMS Reserve File Size function pre-allocates disk space for the data you want to write to the .tdms file. Pre-allocating disk space ensures optimal asynchronous writing performance.
The FIFO.Acquire Read Region method requests a region to read from the host memory buffer in the target device driver and returns an external data value reference to this region.
Note  You must have NI-RIO device drivers and the LabVIEW FPGA Module installed to transfer data using direct memory access.
The TDMS Advanced Asynchronous Write (Data Ref) function iteratively streams the external data from the Acquire Read Region method to the .tdms file.
(Optional) The TDMS Get Asynchronous Write Status (Data Ref) function returns the number of pending writes that exist in the background.
The TDMS Advanced Close function closes the reference to the .tdms file that you opened in the first step.