ni.com is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to concatenate arrays of waveforms?

I am acquiring data from multiple DAQ channels at once, and I need to save the data. I decided to adapt the example program "Cont Acq&Graph Voltage-Int Clk" from the DAQmx folder by listing all of my channels in the Channel Parameters > Physical Channel field box. However, I'm having trouble taking the data from one sample set and concatenating it onto the previous sample set (concatenating an array of waveforms onto the previous array of waveforms). I tried just using the Build Array tool and setting it to Concatenate inputs, but it concatenates in a way that isn't desirable. Does anybody know of a way to do this that wouldn't delay the acquisition loop too much?
0 Kudos
Message 1 of 15
(9,370 Views)
Hello cleat:

You could replace your waveform graph with a waveform chart, and set update mode to "Scroll".
Anyway, this is only for display. Please inform me if this helps you solve your problem.
0 Kudos
Message 2 of 15
(9,356 Views)
This didn't work to well. When I tried to read from a variable linked to the chart, it just gave me one sample set (despite showing multiple sample sets on the display). Also, I think this method stores the data points in RAM, and if I set the plot to display several thousand points, I run out of memory (i suppose the other methods of concatenation probably do the same - or do they save on the hard disk?).
0 Kudos
Message 3 of 15
(9,347 Views)
Why not just use the build array function and right click on it and select concatenate inputs for numeric arrays or you can use append waveforms.VI and it will do the concatenation of waveforms.

hope this helps



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 15
(9,344 Views)
Using the Build Array > Concatenate Inputs results in a concatenation where the waveforms are placed side by side, rather than stacked onto each other. Append Waveforms.VI only works for concatenating a single waveform with another single waveform. The output is an array of waveforms which I want to concatenate onto the previous array of waveforms. I'm thinking the way to do this is just index the array of waveforms and append it onto its previous waveform, for all waveforms in the output array. Then merge them and write to a file. I'm afraid it will delay my measurements by quite a bit, however.
0 Kudos
Message 5 of 15
(9,342 Views)

@cleat wrote:
Using the Build Array > Concatenate Inputs results in a concatenation where the waveforms are placed side by side, rather than stacked onto each other.





I am assuming that by side by side you mean a 1D array and by stacked you mean a 2D array if this is so and you want a 2D array of waveforms then why is it that build array will not help you. Maybe I do not understand what ou want the end reult to look like (give example) then from there maybe I can help you more



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 6 of 15
(9,340 Views)
Ok. The output consists of a 1-D array of waveforms, where each element is one waveform from a particular DAQ channel. I would like to continually acquire data from these channels at once. For just one waveform, I can create a local variable for it, feed the original and the variable into a Append Waveforms.VI (or a Build Array tool if I was using arrays instead of waveforms), and have the output connected to another variable. This allows me to stack the sample sets so that I can save the data from previous sample sets (a set's length being defined by "Samples to Read"). I would like to apply this method to an array of waveforms, so that I can have a history of data from multiple channels. The Append Waveforms.VI only works when desiring to append 1 waveform onto another (no arrays allowed). The Build Array tool does the following:

Wf1 Wf2 Wf3 Wf1 Wf2 Wf3
1 2 3 1 2 3
1 2 3 1 2 3
1 2 3 1 2 3

This is something atleast, but I would like to have this:

Wf1 Wf2 Wf3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3
1 2 3

Make sense?
0 Kudos
Message 7 of 15
(9,336 Views)
That didn't print out the way I wanted it to. This info might clear it up:
Wf1 = 1, 1, 1
Wf2 = 2, 2, 2
Wf3 = 3, 3, 3
0 Kudos
Message 8 of 15
(9,337 Views)
See if this gets you close



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 9 of 15
(9,318 Views)
Hello Cleat,

To get the desired behavior you will need to append the individual waveforms together and rebuild the array. Attached is a small example of how to accomplish this.

Please let me know if you have any questions about the example.

Regards,

Matt F
0 Kudos
Message 10 of 15
(9,312 Views)