From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Read TDMS from C++

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.

0 Kudos
Message 1 of 3
(3,920 Views)

This question has been posted also in the Diadem board where there already is a reply at the moment.

 

In the future try not to post the same question to different boards, or at least place some cross-reference in both boards so that threads are linked.

In this particular case, your mentioning of C++ confuses me: if you really want to use C++ then the CVI board is not the correct one since it uses standard ANSI C, not C++.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,910 Views)

Sorry for the wrong forum , thanks.

0 Kudos
Message 3 of 3
(3,888 Views)