09-25-2022 03:28 PM
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?
09-26-2022 02:03 AM
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…