LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Handle Large Data Generation and DAQmx Analog Output

Solved!
Go to solution

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?

0 Kudos
Message 11 of 19
(117 Views)

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.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 12 of 19
(100 Views)

... 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.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 13 of 19
(92 Views)

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?

luisdclopes2_0-1747929391804.png

 

0 Kudos
Message 14 of 19
(78 Views)

I think I solve this last issue - check if the Total Samples Generated reach the value of written samples.

luisdclopes2_0-1747931267437.png

 

Message 15 of 19
(74 Views)

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.

Message 16 of 19
(64 Views)

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.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 17 of 19
(48 Views)

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?

0 Kudos
Message 18 of 19
(23 Views)

@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

 

mcduff_0-1748014923824.png

 

0 Kudos
Message 19 of 19
(12 Views)