12-04-2013 09:54 AM
Hello,
I want to save my data in a format which can be opened later with cern ROOT software in a linux system.
therefore I'm wondering if it's possible to have a linux library for c++ to read tdms files or at least to have a file offset of this tdms so that I could manually write c++ code in linux to extract the tdms data and convert in a .root file.
I'm quite sure the NI guys wannt to advice me to stay with the tdms format but unfortunately this is not my decision.
So is there hope to have a linux library to read tdms files within a c++/root code or at least to have a offset of this tdms files?
best regards
Solved! Go to Solution.
12-04-2013 08:33 PM
LabVIEW began to have TDMS functions since the 2012 release. So you can install a 2012 and later version of LV to access TDMS files on Linux.
Just for curiosity, which format are you going to be save to?
12-05-2013 03:38 AM - edited 12-05-2013 03:44 AM
I think you misunderstood me or I didn't understand your answer. I need a piece of software ( sourcecode or compiled library) which allows me to read from tdms files from c++ code in an linux environment. There will be no way to install a LabVIEW version on this Linux machines to use it. It all have to be done by c++ in linux. Therefore I need in an ideal case a linux library or c++ sourcecode or at least a detailed structure of this tdms files to write my own software which will read data from this tdms files. If there is no way for this I would have no choice but to design a new data format.
for your question:
a) if there is a way to access the data in tdms files from c++ in linux
Ni5663E -> DAQ-Software (written in LabVIEW) -> save the raw data in .tdms format
raw data in .tdms -> processed by ROOT ( https://en.wikipedia.org/wiki/ROOT , http://root.cern.ch/drupal/ )Software -> results are saved in ROOT Files.
b) if there is no way
I have to design a new data format, this will be a binary files with files and frame headers.
I hope this answers your question.
best regards
12-05-2013 05:40 AM
Hello,
have a look at this whitepaper, topic number four:
http://www.ni.com/white-paper/3727/en/
Might this be what you are looking for?
Kind regards,
Rome
NI Germany
12-05-2013 08:19 AM - edited 12-05-2013 08:20 AM
@RomBe
I know this page and no. Because we dont't use OpenOffice to open hundret of files from the beamtime with a size of 500mb to 1gb each and windows dll don't work in linux (or am i wrong?).
What I'm looking for is c++ code or a linux library i can call from a c++ code that later we can do the following:
c++ code example (just made up to demonstrate what I have to do)
. . . CReadTDMSFile file; file.open("file.tdms"); . . . Long_t lNSamples = file.GetAttribute("NumberOfSamples"); . . . file.close(); . . .
I hope this made clear.
best regards
christian
12-05-2013 08:33 AM
there is a python lib (github?? ask g++gle) to read tdms data , maybe you can include or convert that?
12-05-2013 08:40 AM
@Henrik
Hello and thanks.
I think you were refering to http://sourceforge.net/projects/pytdms/
I haven't used python before but it was quite close to c/c++ (if I'm not wrong) and it runs also in linux.
This seems like a very good solution even if I havent looked in the code yet.
thank you all for your help 🙂
also greetings from germany 🙂
08-03-2021 08:10 AM
Have you solved your problem? If it is solved, can you tell me how you solved it? I also encountered the same problem.
08-03-2021 08:52 AM
I'm not aware of ready made C source code to read and write TDMS files. This document about the internal file format is to my knowledge the best option you have. The developer of the Python library was using it too, to get his library working.
If you end up creating such a library it would be great if you decided to put it on an open source repository like github. 😁
08-03-2021 09:08 AM
Thanks reply
There is no C source code, just a dll file. So I have to find another way to solve this problem. I am currently trying to call the Python library about TDMS in C, but I still don’t know if I can read my existing TDMS file in Linux