LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it allowed read TDMS file while there is a reference open to file?

Hello All,

 

I'm using LV 2010. I have found following problem. In main application I'm writing waveform values to TDMS file. This happens once in every second. In user interface I read this same file about 2 times per second. Everything seems to work okay if both applications are running in development environment. But if I create executable from main application and same time run user interface in development environment I face problems. Not every time but very often whole LabVIEW locks/freeze.

 

I have set user priviledges to data folder open for every user.

 

How I can read and write TDMS file simultaneously without problems ?

 

BR,

 

Jim

 

 

 

 

0 Kudos
Message 1 of 6
(3,419 Views)

TDMS files are special little critters that are not like most files in the sense that opening two unique refs to the same file will let you acess the same data.

 

T0 get the speed required for the most demanding DAQ apps TDMS is implemented as mapped memory and the data does not get written to disk until you close the reference. So I am supporised you have not seen the issue in the development environment.

 

Ben

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 6
(3,403 Views)

Thanks Ben,

 

I'm writing data quite slow to TDMS ( U16  400 S/s) and I don't need exactly current data to user interface.

 

Is it really only option to release reference and let user interface read file and then open it again for writing? I'm receiving data 24 / 7 but only for every second. The reference is open to file almost all the time. I create a new file once a day and only then old reference is closed and new opened. 

 

 

BR, Jim

0 Kudos
Message 3 of 6
(3,393 Views)

Please search on TDMS or chase down my tags where I believe I tagged a thread where Herbert commented on how TDMS is unique (Hebert Engle may be the developers name).

 

He is very good about "supporting his baby" (just like Aristos Queue and Greg McKaskle before him).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(3,385 Views)

I believe TDMS was designed to accept multiple read/write access within the same application.  A lot of effort and thought was put into making this work right.  However, it sounds like you are trying to access it simultaneously from two applications (an executable and a the development environment).  I would not expect this to work.  If you would like to run two LabVIEW executables and have them simultaneously access the same TDMS file, you can probably do this by launching them into the same run-time.  See this post for how to do this.

0 Kudos
Message 5 of 6
(3,353 Views)

I do realize that this is a post from 2011 ;).

 

The answer is yes you can.

When you are running within the same RunTime engine you can easily open a new reference to the file and do this.

When you want to have 2 executables reading and writing at the same time, what you have to do is ensure that your OPEN TDMS is set to open (read-only) and this will work.

 

Attached expample


0 Kudos
Message 6 of 6
(3,141 Views)