LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export to spreadsheet - data from 2 channels appears alternately with producer/consumer loop

Solved!
Go to solution

Hi there,

 

I am having difficulty with "export waveform to spreadsheet" function - but it is not clear to me whether the problem originates from the way I am using the export function or if I am incorrectly concatenating two waveforms from different X series modules upstream from the export, or if my queue is wired incorrectly for the producer-consumer loops.

 

I am using a PXIe-1073 chasses with PXIe-6361 and 4330 modules (voltage and strain). I have tried to modify the "multi-device synch analog input" example for use with a producer-consumer structure (please see attached VI).

 

The spreadsheet output contains a large chunk of data from the voltage channel, followed by a smaller chunk of strain data (with timestamps), after which the data output alternates between voltage and strain data.

 

Can anyone suggest where I might be going wrong, or how I might troubleshoot this?

 

The attachments are not working so I will try to post them in a blank message directly after this post.

 

Thanks,

Claire.

0 Kudos
Message 1 of 10
(1,221 Views)
0 Kudos
Message 2 of 10
(1,220 Views)

Your export to spreadsheet subVI is missing.

0 Kudos
Message 3 of 10
(1,217 Views)

The forum would not allow me to attach the spreadsheet file: this is a screenshot of what it looks like, the pattern of small chunks of data continues similarly for the entire file.

 

0 Kudos
Message 4 of 10
(1,216 Views)

Sorry, here it is (Attached). I modified it to try and get rid of the extra line it was printing between the data lines (but perhaps caused this problem in the process?)

Thanks for your super quick reply!

0 Kudos
Message 5 of 10
(1,214 Views)

Put indicators on your waveforms before building them together in a a larger waveform array.  Could your waveforms be empty on some iterations?

 

Why don't you wire up a value for a number of samples to acquire on each of the DAQmx read functions?

0 Kudos
Message 6 of 10
(1,211 Views)

Hi Ravens Fan,

Yes, you're right, by wiring some indicators, I can see that the data comes through from the two streams intermittently (althought the plots don't look discontinuous). So, something incorrect is happening in the "Read". Could it be a problem with having two DAQmxRead blocks in the one producer loop?

Thanks,

Claire.

0 Kudos
Message 7 of 10
(1,206 Views)

Oh, and I have wired the NSamples to "-1" now as I want the Read to occur continuously until "stop" is pressed.

Thanks,

Claire.

0 Kudos
Message 8 of 10
(1,204 Views)
Solution
Accepted by topic author ClaireJ

That's what I figured.

 

Wire a number.  -1 gives all available samples in the buffer (which could possibly be zero for some reason).  A number will wait until that many samples are available.  So both reads will wait until they both have the amount of data requested.  This way they will also have the same number of samples and be better aligned in the text file.

 

Your loop will keep running until you press stop or get an error.

Message 9 of 10
(1,199 Views)

Thanks! that worked perfectly. I misunderstood what the "number of samples" parameter would do.

Really appreciate your speedy help, and for stepping me through the troubleshooting.

Cheers,

Claire

0 Kudos
Message 10 of 10
(1,194 Views)