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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS C DLL Error 6210 File is read only

Solved!
Go to solution

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.

 

 

6210DDC_CannotWriteToReadOnlyFileThe 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?

0 Kudos
Message 1 of 6
(4,369 Views)
	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

0 Kudos
Message 2 of 6
(4,346 Views)

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):

0 Kudos
Message 3 of 6
(4,340 Views)

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?

0 Kudos
Message 4 of 6
(4,330 Views)

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.

0 Kudos
Message 5 of 6
(4,275 Views)
Solution
Accepted by topic author rohrs2

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.

0 Kudos
Message 6 of 6
(4,233 Views)