LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2504 has occurred at TDMS close...

I'm currently trying to use DAQmx functions to read samples from two channels and then have the samples read and written to a TDMS file (see attached image) and I am able to collect data effectively without problem, however I am getting the error "-2504" when the code tries to close the TDMS_close.vi (see the other attached image). I am completely stumped as to what could be causing it and can't find any reference to this error anywhere.

Thanks for your help.

0 Kudos
Message 1 of 11
(2,645 Views)

If you aren't able to answer, are you able to suggest any way of me getting help for this error? Literally any help is appreciated, thanks.

0 Kudos
Message 2 of 11
(2,602 Views)

@AHLabVIEW wrote:

If you aren't able to answer, are you able to suggest any way of me getting help for this error? Literally any help is appreciated, thanks.


You haven't shown us any code to help you out with.   Seriously,  we have no idea what is in the false case, what else is in the Sequence Structure or if the filename is valid.  Or the origin of the 2d array that you write then read as an array of wave forms.  What else has the same file opened?  Why aren't you using DAQmx logging?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 11
(2,593 Views)

Sorry for not providing enough information, I had attached the code below, hopefully that helps. The filename should be valid as the code has previously created/opened a file with the name specified and the data can be collected efficiently, as the graph at the end is plotted and shows the expected sample rate/ pattern. 

 

The code is also based heavily on the following video in which TSMS functions are also used.

0 Kudos
Message 4 of 11
(2,576 Views)

It concerns me that it looks like you are writing directly to a server.  Perhaps you could try a local directory and see if the error goes away.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(2,571 Views)

Hello

Try to change the filepath for the TDMS, some customers have reported similar issue when the dsik is full, looks like the TDMS write funcion does not throw the error , it happens until TDMS close is executed.

0 Kudos
Message 6 of 11
(2,553 Views)

Hi, thanks for the suggestions. I've found that data is still being saved to the file in excel format and that i can still access this data despite the error (if this helps with the troubleshooting). I've tried saving the file to many different locations and it hasn't changed the error so far. As it stands, I can still access the data, so I'm not sure what the error is actually preventing. Either way, thanks for your help :).

0 Kudos
Message 7 of 11
(2,538 Views)

Hi

I also recommend to move the TDMS read and TDMS close after the DAQmx Stop task function. 

Just to make sure code flow is not doing something unexpected.

I like to think , if we try something different we might get a different result.

If you are completely sure the error is not causing you a problem or misbehaiviour , try to ingnore it  (unbuldle the error , read the error number and when is equal to yours , set the cluster error as no error, then will not propagate any further)

0 Kudos
Message 8 of 11
(2,499 Views)

Hi, 

 

I don't know if you ever solved this problem, but this might help anyone who has this error code in the future

 

Error -2504 occurs for me on TDMS Close when there is not enough space on the hard drive to save the TDMS file. Clearing some space immediately resolved the issue

 

Hope that helps someone!

0 Kudos
Message 9 of 11
(2,287 Views)

I just want to add to this that for me the error consistently happens when trying to save to a network drive.
The easiest setup to reproduce it is to try to create+close a tdms file on a remote drive. Using just the 2 primitives you can see that the file is being created but not closed.

0 Kudos
Message 10 of 11
(1,799 Views)