04-07-2012 10:46 AM
Hi I'm using TDMS format to my project.
I succedd to log the whole data into TDMS file by using the
DAQmxConfigureLogging(taskHandle, logFile.toAscii().constData() ,DAQmx_Val_LogAndRead,"GroupName",DAQmx_Val_OpenOrCreate)
Now my problem is that when I'm trying to read the TDMS file I can't open it.
My code of reading is (from the TDMStesing example):
unsigned int length; int ddcError = 0; DDCFileHandle file = 0; char *property = 0; // Read file name ddcChk (DDC_OpenFileEx (FILE_PATH, "TDMS", 1, &file)); ddcChk (DDC_GetFileStringPropertyLength (file, DDC_FILE_NAME, &length)); nullChk (property = (char*)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 = (char*)malloc (length + 1)); ddcChk (DDC_GetFileProperty (file, DDC_FILE_DESCRIPTION, property, length + 1)); printf ("File description property: %s\n", property); free (property); property = 0; } // Read the channel groups ddcChk (ReadGroups (file)); Error: if (property) free (property); if (file) DDC_CloseFile (file); return ddcError;
When I debug the code I got the error code of -6204 at the DDC_OpenFileEx function
Error details http://zone.ni.com/reference/en-XX/help/370051K-01/cvi/cvidiademlibraryerrors/
-6204 | DDC_UnexpectedError | An unexpected error occurred in the library. |
Need help...
My setup:
Hardware: NI 9234
NI-Daqmx: device driver 9.4.0f5
Windows version: XP (sp3)
Language: Qt (C++)
Solved! Go to Solution.
04-08-2012 07:53 PM
simon27,
Could you check whether your tdms file is corrupted? If you have LabVIEW installed, you could open your tdms file using LabVIEW "TDMS File Viewer" (http://zone.ni.com/reference/en-XX/help/371361H-01/lvdialog/tdms_file_viewer_db/).
Best Regards,
Bo Xie
04-09-2012 02:45 AM
I succedd to open it via Excel but not with C code.
Here attachemnt of the TDMS file
04-09-2012 02:46 AM
I succeed to open it via Excel but not with C code.
Here attachemnt of the TDMS file
06-23-2012 09:32 AM
Still need your help...
06-23-2012 12:10 PM
Hi all,
I added the DataModels libs to the project and I succedd to read TDMS file.
BUT, now I'm trying to read TDMS 2.0 file and I got the next message:
ERROR: TDS Exception in Initialize: Tds Error: TdsErrFileVersionTooNew(-2510)
err id : -6210
Need help
Atteched the TDMS file
06-25-2012 04:48 PM
Hi simon27,
What version of the DataModels library do you have? Which c development environment are you using? The error 6210 says that the file you are trying to open is read only. Did you have it open and tried to read from it?
Regards,
Perry S.
Applications Engineer
06-26-2012 08:50 AM
Hi Perry S,
I realy don't know what version is the Data Models, I used the drivers from the TDMSTesting code that I found in the forum.
I succeed to open the file via excel and to read it.
I'm working on Qt 4.7 C++ enviroment
I attach the code example that I used for this testing.
06-27-2012 05:29 PM
Hi Simon27,
Just to clarify, did you create this TDMS file? If not where did you get it? In which forum did you get the TDMS Testing Code? Could you place a link to it here?
Regards,
Perry S.
Applications Engineer
06-27-2012 05:29 PM
Hi Simon27,
Just to clarify, did you create this TDMS file? If not where did you get it? In which forum did you get the TDMS Testing Code? Could you place a link to it here?
Regards,
Perry S.
Applications Engineer