LabWindows/CVI

TDMS_AdvancedSyncWrite

int TDMS_AdvancedSyncWrite (TDMSFileHandle file, void *samples, size_t numberOfSamples, TDMSDataType dataType);

Purpose

Writes data to the specified file.

(Linux) This function is not supported.

Parameters

Input
Name Type Description
file TDMSFileHandle The file handle. You obtain this handle from TDMS_AdvancedOpenFile or TDMS_AdvancedCreateFile. You must not specify the enable asynchronous operations option when you open or create the file.
samples void * An array containing samples that will be written to the specified file.

The type of this array should match the type of the samples you are writing. This function does not support writing samples of type string.

If the type of the samples you are writing is TDMS_Timestamp, you must pass an array of type CVIAbsoluteTime. Refer to the Absolute Time functions in the Utility Library for more information about this type.

Note Note  The alignment of the pointer value passed for this parameter can significantly impact the performance of this write operation. The performance impact varies depending on the hardware being used. National Instruments recommends a minimal alignment of 512 bytes and a preferred alignment of 4096 bytes. Call TDMS_AllocateAlignedMemory to allocate aligned memory for this parameter.
numberOfSamples size_t The number of samples to write.
Note Note   If you specified the disable buffering option when you opened the file using TDMS_AdvancedOpenFile or TDMS_AdvancedCreateFile, then the number of samples should correspond to a number of bytes that is an even multiple of the sector size of the hard disk. This is necessary so that subsequent calls to this function will read from a position in the file that is aligned on a hard disk sector boundary. This requirement does not apply to the last call to this function that corresponds to a single call to TDMS_ConfigureAsyncWrites. The sector size of the hard disk is available as an output parameter from TDMS_AdvancedOpenFile or TDMS_AdvancedCreateFile.
dataType TDMSDataType The data type of the samples to write. This function does not support writing samples of type string.

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.

Example

Refer to TDM Streaming\Advanced Read and Write\TDMS Advanced Sync Write\TDMS Advanced Sync Write.cws for an example of using the TDMS_AdvancedSyncWrite function.

Log in to get a better experience