From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why TDMS Open is failing on second attempt?

Hello,

 

I have created the following VI (part of a bigger block diagram) to create and/or overwrite TDMS files. the diagram I have attached is for the latter case.

When I first run the VI, select a file that I wish to overwrite, its executed correctly. 

once 'new' file is created and closed, if I then re-attempt to overwrite the file again I am getting ERR(5) even though prior to replacing the file, I have an OK from the TDMS close block!

 

Anyone able to suggest why this is the case and how to resolve it please?

 

sherzaad_0-1664137643784.png

 

0 Kudos
Message 1 of 2
(587 Views)

Hi sherzaad,

 


@sherzaad wrote:

Anyone able to suggest why this is the case and how to resolve it please?


Why: you send a "FileClose" request to the TDMS file handler and it will start the closing procedure for that file. This may include flushing remaining buffers to the TDMS file and creating an additional index file - which will take some time. When you immediatly try to open/replace the file again it is still being processed - and so you get an "error 5"…

 

How: wait for some time before accessing the file again. Either use a fixed wait time or try to open the file until there is no error anymore…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(543 Views)