LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Three Data Sets Into One Text File

Solved!
Go to solution

Hello,

 

I think this will be a simple problem but I'm stuck with it.

 

Could anyone be so kind as to show me how to put 3 data sets: V-time, SPD plot, V^2-time on the vi, into one txt file (to use on a spreadsheet).

 

Please find vi attached.

 

Thanks.

0 Kudos
Message 1 of 19
(2,690 Views)

Since you are using Express VI's and the blue dynamic datatype wire, there is a function Express >>  Signal Manipulation palette called Merge Signals.

Message 2 of 19
(2,686 Views)

If you can post the vi in version 2009  or earlier, I can have a look at it.



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
Message 3 of 19
(2,685 Views)

As Ravens said, use the Merge Signals instead of the build array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 19
(2,677 Views)

Many thanks for the quick response guys.

 

I have used merge but get this when i run the vi:

 

Error -200279 occurred at 3chan.vi:Instance:2:1

 

Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<2>

 

Any ideas? The DAQ is a NI usb 4431

 

Thanks and kudos to you all.

0 Kudos
Message 5 of 19
(2,665 Views)

You are reading only 1000 samples per shot from a data acquistion of ~51,000 samples per second.  That means your loop iteration has to occur in less than 20 milliseconds to keep up.  Writing data to a file can take a long time and be inconsistent on how quickly it can execute.  So your loop rate can't keep up with how fast the data is coming into the DAQ buffer.

 

I suggest using a producer/consumer architecture to pass the file writing off to a separate loop.

Message 6 of 19
(2,661 Views)

Ok right, I understand what your saying.

 

Would you be able to show me what I need to do to correct this/do your suggestion? It would be much appreciated as I'm quite a novice at the moment!

 

Thanks

 

 

0 Kudos
Message 7 of 19
(2,646 Views)

There are already hundreds if not thousands examples of this on the forums.

 

Also, look at the File / New ... menu and pick Producer/Consumer out of the example templates.

Message 8 of 19
(2,642 Views)

As Ravens stated (I feel like I'm saying that a lot today), look into the Producer/Consumer architecture.  It is based on using a queue to send the data from 1 loop to another.  Each loop can run in parallel.  Therefore your saving to disk and reading the DAQ can work in parallel.

I would suggest keeping your DAQ reads in a loop by itself, sending the data into the queue.  Then the consumer loop performs your calculations and logs the data to disk.

http://www.ni.com/white-paper/3023/en


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 19
(2,641 Views)

Thanks to you both.

 

I will give it a try tomorrow morning. Smiley Happy

0 Kudos
Message 10 of 19
(2,634 Views)