LabWindows/CVI

TDMS_SetFileProperty

int TDMS_SetFileProperty (TDMSFileHandle file, const char *property, TDMSDataType dataType, ...);

Purpose

Sets the value of a file property. If the property does not exist, this function creates it.

Parameters

Input
Name Type Description
file TDMSFileHandle The file handle. You obtain this handle from the TDMS_OpenFileEx, TDMS_CreateFileEx, TDMS_AdvancedOpenFile, or TDMS_AdvancedCreateFile function.
property const char * The name of the file property. You can specify a built-in property, virtual property, or a property created by TDMS_SetFileProperty. Virtual properties are special properties that are not saved in the .tdms file, but they can be used to perform certain actions.

The following built-in properties are available:

Property Constant Data Type
Name TDMS_FILE_NAME String (char *)
Description TDMS_FILE_DESCRIPTION String (char *)
Title TDMS_FILE_TITLE String (char *)
Author TDMS_FILE_AUTHOR String (char *)


The following virtual properties are available:

Property Constant Data Type Description
NI_DiskCacheSize TDMS_NI_DISK_CACHE_SIZE unsigned int You can use the NI_DiskCacheSize property to improve .tdms data writing performance by allocating a specific amount of cache size in memory for data. This property is valid only when the file was opened with the TDMS_OpenFileDisableBuffering option. The default value for this property is approximately 2 MB. A greater value for the NI_DiskCacheSize property usually can improve the writing performance; however, a greater value also requires more computer resources.
NI_DiskGapSize TDMS_NI_DISK_GAP_SIZE unsigned int You can use the NI_DiskGapSize property to improve .tdms data reading performance when reading discontinuous data. This property is valid only when the file was opened with the TDMS_OpenFileDisableBuffering option. The value of the NI_DiskGapSize property is a multiple of the sector size of the local hard disk. The default value for this property is 10. If the data gap in the .tdms file is less than the value of the NI_DiskGapSize property, the TDMS read functions can read all data from the file at one time. If the data gap in the .tdms file is greater than the value of the NI_DiskGapSize property, the TDMS read functions read each piece of data one at a time until it finishes reading all data.
Note Note  Obtaining the optimal reading and writing performance is a trial-and-error process. The same configuration might not return the same optimal performance on different computers. You might need to adjust the property values after you deploy an application from one computer to another.
NI_MinimumBufferSize TDMS_NI_MINIMUM_BUFFER_SIZE unsigned int Use this property to reduce the size of a .tdms file by controlling the number of times the data is written to disk.
NI_InMemoryWriteBlockSize TDMS_NI_IN_MEMORY_WRITE_BLOCK_SIZE long long This property is used to allocate the block size in memory for writing the data. The default value for this property is 10 MB. The valid value range for this property is [1KB, 1GB]. A greater value for this property usually can improve in-memory reading performance by allocating less blocks; however, an unnecessarily great value also requires more computer resources. This property must be set before the actual writing process otherwise an error will be returned. If you set this property multiple times, only the latest one will take effect.
dataType TDMSDataType The data type of the property.

If the data type of the property is TDMS_Timestamp, you must use the CVIAbsoluteTime type when you set or get the value of that property. Refer to the Absolute Time functions in the Utility Library for more information about this data type.
value ... The value of the property.

If the data type of the specified property is TDMS_Timestamp, you must pass a value of type CVIAbsoluteTime. Refer to the Absolute Time functions in the Utility Library for more information about this type.

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.