11-20-2020 10:48 AM
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.
11-22-2020 04:42 AM
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.
11-22-2020 01:44 PM
@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?
11-23-2020 04:17 AM
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.
11-23-2020 05:05 AM
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.
11-25-2020 12:20 PM
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.
11-26-2020 08:48 AM
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 :).
12-01-2020 09:39 AM
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)
08-24-2021 05:05 AM
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!
02-02-2023 09:32 AM
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.