09-30-2016 01:48 AM
hi all,
we are trying to read the TDMS property by using the TDM C DLL sample, copied the sample code below
// Reads the file
static int ReadFile (void)
{
int ddcError = 0, length;
DDCFileHandle file = 0;
char *property = 0;
// Read file name
ddcChk (DDC_OpenFileEx (FILE_PATH, "TDM", 1, &file));
ddcChk (DDC_GetFileStringPropertyLength (file, DDC_FILE_NAME, &length));
nullChk (property = malloc (length + 1));
ddcChk (DDC_GetFileProperty (file, DDC_FILE_NAME, property, length + 1));
printf ("File name property: %s\n", property);
free (property);
property = 0;
// Read file description, if present
if (DDC_GetFileStringPropertyLength (file, DDC_FILE_DESCRIPTION, &length) >= 0)
{
nullChk (property = malloc (length + 1));
ddcChk (DDC_GetFileProperty (file, DDC_FILE_DESCRIPTION, property, length + 1));
printf ("File description property: %s\n", property);
free (property);
property = 0;
}
We are able to read the property length, but we need to read the value of wf_increment.
Any help on this is appreciable.
09-30-2016 04:18 AM
double wf_increment = 0.0; ddcChk (DDC_GetChannelProperty(channelsId, "wf_increment", &wf_increment, sizeof(double)));
is the code needed to read a double value. Be aware that there are channels that have no waveform properties.