Hi heang,
The error -20013 indicates that the width supplied for the Waveform
Peak Detection.vi must meet the requirement 0 < width < samples.
It seems like you are acquiring one point at each iteration. Then you are feeding that one sample to Waveform Peak
Detection with width > 1, hence you are getting the error. To fix the
problem, I would suggest you acquire multiple data points at each
iteration of the while loop instead, or acquire all of your data first,
and then find the peaks and write them to a file.
Another option is to move the Waveform Peak Detection, Merge Signals and
Write Peak Data VIs to outside of the while loop. Be sure to enable the
indexing of your data terminal to be able to
access the entire data acquired from outside the while loop.
Michael K.
| Michael K | Project Manager | LabVIEW R&D | National Instruments |