Wilroy Posted August 16, 2008 Report Share Posted August 16, 2008 Hello LAVA, I have four analog voltage signals coming into an SCB-68 and a PCI-6259 M. I would like to sample the four signals at 10 ksamples per sec, for a duration on the order of a couple of minutes. I use a DAQmx read and Export_Waveforms in a while loop, as shown in the attached image (Acq.jpg). I find there are blank rows distributed through out the output file, as shown in the attached image (Textfile.jpg). These blank rows have zero values associated with them that are undesirably inserted into the acquired signals. It seems a null row is inserted at every iteration of the while loop. The frequency of null row occurrence and number of null rows per occurrence seems to depend on sampling rate and loop execution time (experimented with putting Wait_until_next_ms_multiple in the loop). Suggestions on how to remove these rows with null values would be greatly appreciated. I am running LabVIEW 8.5.1 on XP. Cheers, Wilroy. Quote Link to comment
LAVA 1.0 Content Posted August 16, 2008 Report Share Posted August 16, 2008 Hello Wilroy, what kind of function do you use to write the file to disc? I don't recognize it of hand. Why do you open and close the file without writing to it? To display a browse dialog you can better use the file dialog function. Ton Quote Link to comment
mje Posted August 16, 2008 Report Share Posted August 16, 2008 It's a waveform data serialization VI, you'll find it in the Waveform :: Waveform File I/O palette. The code below illustrates your problem, it will generate five newline sequences in the file specified. Note I'm supplying no waveform data to the VI. What happens in your example is your read VI is returning however many samples are ready in your input buffer, which could be zero if you read too fast (this is because of the -1 value supplied to Number of Samples per Channel) . The VI will happily return an empty waveform when the buffer is empty, and in response to this, the serialization VI will write a blank line to disk. You can mitigate this by requiring the loop to obtain a certain number of samples, checking for an empty waveform, retrieving only the number of samples in the buffer, or whatever works best for your situation. -michael Quote Link to comment
Jeffrey Habets Posted August 17, 2008 Report Share Posted August 17, 2008 It's actually a problem of the Export Waveforms To Spreadsheet File itself (I looked at the 1D polymorphic instance of it, haven't checked the others). With every call, it writes one row of (empty) data to many.. I think the problem is the Incr function (see attached picture), although I haven't checked if it would break other functionality of the VI if it would be removed. Question to NI would be, is this expected behaviour or is it a bug. I would think the latter. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.