08-06-2012 10:25 AM
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.
Solved! Go to Solution.
08-06-2012 10:30 AM
Since you are using Express VI's and the blue dynamic datatype wire, there is a function Express >> Signal Manipulation palette called Merge Signals.
08-06-2012 10:31 AM
If you can post the vi in version 2009 or earlier, I can have a look at it.
08-06-2012 10:47 AM - edited 08-06-2012 10:48 AM
As Ravens said, use the Merge Signals instead of the build array.
08-06-2012 11:04 AM
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.
08-06-2012 11:10 AM
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.
08-06-2012 12:06 PM
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
08-06-2012 12:11 PM
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.
08-06-2012 12:11 PM
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
08-06-2012 12:18 PM
Thanks to you both.
I will give it a try tomorrow morning.