TDMS_GetChannelProperty
- Updated2023-02-21
- 2 minute(s) read
TDMS_GetChannelProperty
int TDMS_GetChannelProperty (TDMSChannelHandle channel, const char *property, void *value, size_t valueSizeInBytes);
Purpose
Gets the value of a channel property.
Parameters
Input | ||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||
channel | TDMSChannelHandle | The channel handle. | ||||||||||||||||||||
property | const char * | The name of the channel property. You can specify a built-in property, virtual property, or a property created by TDMS_SetChannelProperty. 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:
The following virtual properties are available:
|
||||||||||||||||||||
valueSizeInBytes | size_t | The size in bytes of the memory location specified by the value parameter. For example, if the attribute you are getting is of type string, pass the size of the string buffer you are passing for the value parameter. If the attribute you are getting is of type double, pass the size of a double: sizeof(double). If the value you pass for this parameter is less than the size required for a string attribute, the value of the string attribute that you get will be truncated but still contains the terminating NUL byte. |
||||||||||||||||||||
Output | ||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||
value | void * | The pointer that receives the value of the specified channel property. The type of this pointer must match the data type of the specified property. You can call TDMS_GetChannelPropertyType to get the data type of a channel property. If the data type of the specified property is string, you must pass an array of characters. This array must be large enough to hold the entire string as reported by TDMS_GetChannelStringPropertyLength plus the terminating NUL byte. Sample code is shown below: char value[256]; TDMS_GetChannelProperty (file, "MyStringProperty", value, sizeof(value)); If the data type of the specified property is TDMS_Timestamp, you must pass a pointer to 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.
Example
Refer to TDM Streaming\tdmsReader.cws for an example of using the TDMS_GetChannelProperty function.