LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2501 Invalid TDMS File Reference

Solved!
Go to solution

Hello. Im using LabVIEW 2013 for myRIO on Windows 7. Im trying to perform a simulation for sensor readings from 0-5 and then log the data. Ive used the random number generator to obtain readings. So my code runs fine (almost), Ive used Notifiers to stop multiple loops with one Stop button. I've put timers too. Im using TDMS files to log the data. Ive opened one common TDMS file in which i want to log 4 different groups of readings. Im getting the "-2501" error, "Invalid File Reference" .. How do i get rid of it ? My VI is attached below. 

Thanks in advance 🙂

0 Kudos
Message 1 of 5
(5,755 Views)
Solution
Accepted by topic author deepen_solanki

Hi,

In your attachment VI, you wired 1 "TDMS Open" with 4 "TDMS Close". If any of "TDMS Close" was executed, the other 3 reference became invalid. That's why you meet error -2501 and it is expected behavior.

Actually, 1 "TDMS Open" should  only be wired to 1 "TDMS Close" and make sure "TDMS Close" is invoked after all the TDMS operation. You could put it in a "Flat Sequence Structure" to solve the problem. I've modified your VI in the attachment.

Thanks.

0 Kudos
Message 2 of 5
(5,706 Views)

Thank You so much !! 🙂

0 Kudos
Message 3 of 5
(5,692 Views)

I would avoid Flat Sequence Structures unless absolutely necessary, and this is not the case.

0 Kudos
Message 4 of 5
(5,451 Views)

I know this is an old thread, but I just came up with another cause for this error and I wanted to leave a record for someone else who might encounter it. Running LabVIEW 2016 RT with a cDAQ-9133 (Linux OS) this error can occur if the file you are trying to access already exists, but is corrupted in someway.

 

The "fix" is to try saving to a different file.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 5
(5,098 Views)