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.
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.
07-05-2016 11:54 AM
I am trying to use VS2015 to extract data from TDMS files, however I am getting this error when I try to open the file.
6210 | DDC_CannotWriteToReadOnlyFile | The file passed to the library is read only and cannot be modified. |
This happens with both DDC_OpenFile and DDC_OpenFileEx.
ddcChk (DDC_OpenFileEx (FILE_PATH, "TDMS", false , &file));
ddcChk (DDC_OpenFileEx (FILE_PATH, "TDMS", true, &file));
ddcChk (DDC_OpenFileEx (FILE_PATH, "TDMS", 0, &file));
ddcChk (DDC_OpenFileEx (FILE_PATH, "TDMS", 1, &file));
ddcChk (DDC_OpenFile (FILE_PATH, "TDMS", &file));
Is there a way to open read only files in VS or change the access in VS before opening?
Solved! Go to Solution.
07-06-2016 01:29 AM
ddcChk (DDC_OpenFileEx (filePath, "TDMS", 1, &file));
Works for me. It works for readonly and even for folders without write rights.
Is the NI Excel Addin capable to read the files?
Andreas
07-06-2016 06:18 AM - edited 07-06-2016 06:33 AM
I can open the file in with the Excel Add-on.
Additionally a .log was created with this error
ERROR: TDS Exception in Initialize: Tds Error: TdsErrFileVersionTooNew(-2510):
07-06-2016 07:21 AM
The tdms_ebd.dll in you folder should be 2.5.0.49152.
Its included in the current download.
Is it possible to share a file if this is your version?
07-12-2016 10:45 AM
I apologize for the delay. Initially the files were not closing properly. However upon fixing this issue I still receive the "file is read only" error. Attached is the solution I am using which I obtained from these forums. The Test01-160711.tdms file is the file I am trying to open. This file does open on both matlab and excel.
07-14-2016 12:06 PM
The previous comments were correct, using an old dll package does not work. For everyone that is searching for the solution or how to set up tdms c dll in visual studios (VS 2015 here, Win32):
1) Grab the new c dll from the comment above.
2) Make a new blank win32 app project.
2) Move the contents of \c_dll_tdm\TDM C DLL\dev\bin\32-bit to working directory
3) Move \c_dll_tdm\TDM C DLL\dev\include folder to working directory
4) Move \c_dll_tdm\TDM C DLL\dev\lib folder to working directory
5) Move/copy contents of the \c_dll_tdm\TDM C DLL\samples\readFile.c code to your working directory/source file. (The variable length must be changed to an unsigned int for it to work with c++).
5) Follow these instuctions here to include your working directory (Step 7+). Add the working directory to your source file properties, but add the library to the Project properties
That did it for me I can successfully open TDMS files. Thank you for the help and link to new DLL! I hope this can help some people that are also new to VS.