05-22-2025 05:56 AM - edited 05-22-2025 05:58 AM
I am getting the error -200560 on the DAQmx Wait Until Done.vi. I think this is because i am reading chunks out of TDMS file, but the last chunk have less points then the defined chunk size, so it waits forever until completely read the remaining points. Could it be the reason and how i can tell to stop waiting, only process the remain points?
05-22-2025 07:36 AM
Explanation:
Error -200560 occurred at an unidentified location
Possible reason(s):
Wait Until Done did not indicate that the task was done within the specified timeout.
Increase the timeout, check the program, and make sure connections for external timing and triggering are in place.
A continuous task will never return Done. The example code waits to allow the system to finish outputting samples such as a ramp-down or a final zero value. In a continuous task (with no regeneration), expect wait to return one of two errors: (out of samples) or (timeout). If you need to make sure the last samples in your long waveform are output, increase the timeout,
The example code provided shows errors returned by DAQmx configuration, waveform generation, or DAQmx Write VIs and clears errors returned by DAQmx Wait Until Done.
If you need more specific help, consider attaching your code.
05-22-2025 08:44 AM
... I think this is because i am reading chunks out of TDMS file, but the last chunk have less points then the defined chunk size, so it waits forever until completely read the remaining points. Could it be the reason and how i can tell to stop waiting, only process the remain points?
The TDMS Read waits forever?
Post your code.
05-22-2025 11:03 AM
The TDMS read stops when reached the no.samples, this is known value when the TDMS is generated. If I can't use the wait until done.vi how do I know that all the data points where output, only by time estimation? Don't seems right to me.
Additionally: On this continuous mode the chunks are written on the DAQmx memory in FIFO order? Internally the vi manage the memory to only receive new data when buffer is available?
05-22-2025 11:30 AM
I think I solve this last issue - check if the Total Samples Generated reach the value of written samples.
05-22-2025 12:30 PM
Why are you using NChan when you only have a single channel?
Does the sampling rate of your output match the sampling rate of the file? If not your frequencies will be off.
Open the file outside of the loop, and read chunks while inside the loop, then close the file outside the loop.
Choose a chunk size that is a multiple of the disk sector size.
05-22-2025 05:01 PM
In theory, I like your solution to making sure that all samples were generated. FYI, when I run that code with DAQmx 24.5.2 outputting to a PXIe-4468, the TotalSampPerChannelGenerated continuously goes up. TotalSampPerChannelGenerated does not stop at total samples computed/read.
Please follow mcduff's guidance regarding Read From File operations. Especially, read the sample rate from the TDMS File, and compare this rate to the actual sample rate of your device.
05-23-2025 03:39 AM
Thanks for all the tips.
"Why are you using NChan when you only have a single channel?"
"Open the file outside of the loop, and read chunks while inside the loop, then close the file outside the loop."
I was so focused on getting it to work that I overlooked that. I've corrected it now — thank you!
"Does the sampling rate of your output match the sampling rate of the file? If not your frequencies will be off."
Since I generate the waveform and save it to the TDMS file, I already know the sample rate. However, I might modify the code to read the first point from the TDMS file at the beginning to obtain the dt value. From that, I can determine the sample rate.
"Choose a chunk size that is a multiple of the disk sector size."
When you say 'Choose a chunk size that is a multiple of the disk sector size,' do you mean the hard drive's sector size, typically 512 bytes? Is there a way to programmatically get this value? What's the reason for aligning the chunk size this way — is it mainly for performance?
05-23-2025 10:42 AM
@luisdclopes2 wrote:
"Choose a chunk size that is a multiple of the disk sector size."
When you say 'Choose a chunk size that is a multiple of the disk sector size,' do you mean the hard drive's sector size, typically 512 bytes? Is there a way to programmatically get this value? What's the reason for aligning the chunk size this way — is it mainly for performance?
Performance is way better. Look in the File Pallette, under Advanced File Functions