LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can create TDM file but not TDMS file using C Dll

We have our own C# app from which we want to export data to view in LabView. I have downloaded the C dll package and copied the bin folder's contents into our application directory. The version on the nilibddc.dll file is 17.0.1.

 

When I try and create a "TDM" file using the DDC_CreateFile method then the log content can be serialized to the file and that file can be viewed in LabView and using the Excel plugin.

 

If I try and create a "TDMS" file using the DDC_CreateFile method then I get a -6211 "The storage could not be opened" error.

 

This is a 32 bit application running on a 64 bit machine.

 

I have downloaded and installed the TDMS plugin and the Excel plugin although I doubt that would help as presumably they installed 64 bit versions of the artefacts to match the machine's architecture.

 

I have tried running our app as an admin in case there is the use of kernel mode drivers but that didn't help.

 

Note that I only copied the C dll artefacts, I have not registered any com servers on any of the accompanying dlls as there are no instructions to do so and it's not obvious which of them would require it.

 

Does anyone have any idea as to what the solution could be?

 

Thanks, Ian

0 Kudos
Message 1 of 8
(1,089 Views)

Hello Ian,

 

Have you seen this article?

__________________________________________
The best way to thank, is to give KUDOS
0 Kudos
Message 2 of 8
(1,035 Views)

Hello,

I have got the same issue.

I am working on C++ application and I would like to use TDMS format.
I have downloaded TDM C DLL (https://www.ni.com/en/support/documentation/supplemental/06/the-ni-tdms-file-format.html?srsltid=Afm...)

 

When I call this (based on example provided in TDM C DLL):

DDCFileHandle file = 0;
int retVal= DDC_CreateFile("C:/test/test1.tdm", "TDM", "Example", "", "", "", &file);

retVal = 0 and file is created.

 

But when I want to switch to TDMS:

DDCFileHandle file = 0;
int retVal= DDC_CreateFile("C:/test/test1.tdms", "TDMS", "Example", "", "", "", &file);

retVal = -6211 ( error code -> DDC_StorageCouldNotBeOpened) and file is not created.

Can anybody help? Why it is not working? Thank you.

0 Kudos
Message 3 of 8
(139 Views)

@colubgo1 wrote:

I'm using TDMS files for logging raw vibration data, due to the cyclic nature of a test i'm currently working on I would like to have a new datasheet for each cycle. The above code is what I came up with. When the State machine vi says it is time for a new data sheet the "creating a new vibration file" case structure closes the old file, replaces the file name with the next count, and opens a new file. This should allow me to use the same reference wire through the shift register.


That wasn't even a try to answer my question but ok:)

0 Kudos
Message 4 of 8
(121 Views)

@michal_t wrote:

@colubgo1 wrote:

I'm using TDMS files for logging raw vibration data, due to the cyclic nature of a test i'm currently working on I would like to have a new datasheet for each cycle. The above code is what I came up with. When the State machine vi says it is time for a new data sheet the "creating a new vibration file" case structure closes the old file, replaces the file name with the next count, and opens a new file. This should allow me to use the same reference wire through the shift register.


That wasn't even a try to answer my question but ok:)


Colub .. new user, 1 post not related to the topic ... looks like a bot.

Yup, copied from here: Problems Replacing the active TDMS file : r/LabVIEW

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 8
(72 Views)

There used to be LabWindows/CVI, which I believe did support TDMS read and writing. It may be possible to reuse the underlaying DLL for that but that is a brittle and cumbersome solution. Looking on the net I can find several open source libraries supporting reading TDMS files but not many that support writing them.

 

One notable exception seems to be: https://github.com/MahdaSystem/TDMS

 

I haven't used it nor tested it and only had a brief glance at the project, but it may be a starting point. I find the particular choice of API a bit strange but it's what it is.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 8
(60 Views)

@VA.KI wrote:

Hello Ian,

 

Have you seen this article?


That's a broken link?

0 Kudos
Message 7 of 8
(40 Views)

Sorry, this is also not an answer to your question 😁...

 

There's a F#\C# TDMS library on Github:

 

TDMS 2.0 File Support for F# and C# (follow "source repository" to https://github.com/mettekou/FSharp.Data.Tdms/)

 

Iff it's good, it seems like a more direct approach.

 

Haven't used it...

0 Kudos
Message 8 of 8
(39 Views)