12-06-2013 09:43 AM - edited 12-06-2013 09:45 AM
How to make a Labview program so that, the successive outputs should be sorted in two separate columns. For example, if I have a program named "Read", for each run of "Read", it will give an output. I wan to run it, say, 200 times. I want to put the successive outputs in two columns P and Q. The output of the first run in column P, 2nd run in column Q, 3rd again in coumn P (second row), 4th in colum Q (second row), 5th in column P(third row), 6th in column Q(third row) so and so...... How can I make this loop?
Better if I can use a for loop! but confusing how to separate into two columns...
I am new in Labview. It would be great if someone can give me a sample program to illustrate this. Thanks a lot...
12-06-2013 10:00 AM
I would use a FOR loop with 2 calls of your subVI in it. You can then combine the results into an array (Build Array) and use Autoindexing to come out with a 2D array.
12-06-2013 10:53 AM - edited 12-06-2013 10:53 AM
You can also run your program in a loop and index the output into a 1D array and then use Decimate 1D Array.vi (in the Array Palette) to split it into two arrays that contain alternating values from the original array.
12-06-2013 11:06 AM
@NIquist wrote:
You can also run your program in a loop and index the output into a 1D array and then...
That's a good idea. If the OP wants a 2D array, I would use the Reshape Array function. Then you can turn it into however many columns you want. A lot more extensible than my original idea.
12-06-2013 11:11 AM
decimate, build (do not concat) and transpose
Those functions on the array manipulation palatte can be fairly helpful. A quick look through the help is in order.
12-06-2013 11:42 AM
Or, if you need to scale it up to an arbitrary number of columns the Signal operations palatte has a real gem.
12-06-2013 12:11 PM - edited 12-06-2013 12:13 PM
@JÞB wrote:
Or, if you need to scale it up to an arbitrary number of columns the Signal operations palatte has a real gem.
Or you could just use Reshape Array...