LabWindows/CVI

TDMS_SetChannelInfo

int TDMS_SetChannelInfo (TDMSChannelHandle channels[], size_t numberOfChannels, size_t samplesPerChannel, TDMSDataLayout dataLayout);

Purpose

Defines the channel information of the data that you will write to the file. The channel information includes the channels, the number of samples per channel, and the data layout.

Note Note  If you use this function multiple times in an application, the order in which you use this function determines the order of channels and groups that you write to a .tdms file.

(Linux) This function is not supported.

Parameters

Input
Name Type Description
channels TDMSChannelHandle [] An array of handles to the channels associated with the data values that will be written to the file. All of the channels must have the same data type. Channels of data type TDMS_String are not supported.
numberOfChannels size_t The number of channel handles in the array specified by the channels parameter.
samplesPerChannel size_t The number of data samples that each channel contains.
dataLayout TDMSDataLayout The arrangement of the data that you want to stream to a .tdms file.

Pass TDMS_DataLayoutNonInterleaved to indicate that the data contains all of the values for the first channel, followed by all of the values for the second channel, and so on.

Pass TDMS_DataLayoutInterleaved to indicate that the data contains the first value for each channel, followed by the second value for each channel, and so on.

In either layout, the order of the channels is determined by the order of channel handles in the array specified by the channels parameter.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. Unless otherwise stated, zero represents successful execution and a negative number represents the error code.

Error codes are defined in cvi\include\cvitdms.h.

Additional Information

Library: TDM Streaming Library

Include file: cvitdms.h

LabWindows/CVI compatibility: LabWindows/CVI 2013 and later

© 2016 National Instruments. All rights reserved.

Examples

Refer to the following examples that use the TDMS_SetChannelInfo function:

  • TDM Streaming\Advanced Read and Write\TDMS Advanced Async Write\TDMS Advanced Async Write.cws

    Open example
  • TDM Streaming\Advanced Read and Write\TDMS Advanced Async Write Throughput Test\TDMS Advanced Async Write Throughput Test.cws

    Open example
  • TDM Streaming\Advanced Read and Write\TDMS Advanced Sync Write\TDMS Advanced Sync Write.cws

    Open example