LabWindows/CVI

TDMS_CreateFile

int TDMS_CreateFile (const char *filePath, TDMSFileFormat fileFormat, const char *name, const char *description, const char *title, const char *author, TDMSFileHandle *file);

Purpose

Note    This function has been superseded by TDMS_CreateFileEx. The new function takes additional parameters for byte order and options. Calling TDMS_CreateFile is equivalent to calling TDMS_CreateFileEx with TDMS_Streaming1_0 for the fileFormat parameter, TDMS_ByteOrderLittleEndian for the byteOrder parameter, and 0 for the options parameter.

Creates a file handle for a new .tdms file. Pass the new file handle to other TDM Streaming Library functions to modify the file contents. Call TDMS_SaveFile to save the file to disk.

Call the TDMS_CloseFile function to close the file handle when you finish using the file.

Parameters

Input
Name Type Description
filePath const char * The path to the file to create. If this value is not an absolute pathname, then the pathname is relative to the current working directory.
fileFormat TDMSFileFormat The format of the file to be created.

Use the highest version of the file format supported by your system unless you have a specific need for a previous version. Some functionality in this library is only available when you use newer versions of the file format.

The 2.0 version of the TDM Streaming file format includes all features from version 1.0, as well as additional features.
name const char * The value of the Name property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions.
description const char * The value of the Description property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions.
title const char * The value of the Title property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions.
author const char * The value of the Author property of the file object. This property is stored in the file and can be accessed with the TDMS_SetFileProperty and TDMS_GetFileProperty functions.
Output
Name Type Description
file TDMSFileHandle The handle for the TDM Streaming file. Pass this handle to TDM Streaming Library functions that require a file. Call TDMS_SaveFile to save the file to disk. Call TDMS_CloseFile to close the file handle when you finish using the file.

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 8.1 and later

© 2016 National Instruments. All rights reserved.

Example

Refer to TDM Streaming\tdmsWriteBenchmark.cws for an example of using the TDMS_CreateFile function.