LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending data to columns

Solved!
Go to solution

I have a measurement that outputs a pair of values (think of an I-V curve). The sub VI returns a 2D array for each measurement. The calling VI appends these together (auto-indexed out of a for loop) using the build array VI.

 

What I want:

 

A set of columns ranged from left to right in the order they are received.

 

What I am getting:

 

 

[0, 0, 0]
1.958347E-5 5.000259E-1 1.000025E+0 1.500035E+0 1.999947E+0 2.500280E+0 3.000423E+0 3.500254E+0 4.000446E+0 4.500542E+0 5.000187E+0 5.500291E+0 6.000455E+0 6.500276E+0 7.000412E+0 7.500413E+0 8.000116E+0 8.500272E+0 9.000396E+0 9.500244E+0 1.000041E+1 1.050045E+1 1.100026E+1 1.150045E+1 1.200060E+1 1.250039E+1 1.300036E+1 1.350039E+1 1.400053E+1 1.450024E+1 1.500037E+1 1.550033E+1 1.599987E+1 1.649984E+1 1.699996E+1 1.749968E+1 1.799973E+1 1.849971E+1 1.899939E+1 1.949959E+1 1.999971E+1
-1.108471E-7 -1.108471E-7 -1.108471E-7 -1.077212E-7 -8.291498E-8 6.798224E-10 1.718107E-7 4.661255E-7 8.971352E-7 1.450923E-6 2.106715E-6 2.828762E-6 3.715842E-6 4.848981E-6 6.239124E-6 8.133539E-6 1.028556E-5 1.263378E-5 1.538603E-5 1.883875E-5 2.274587E-5 2.677229E-5 3.087474E-5 3.524575E-5 3.952161E-5 4.438948E-5 5.033059E-5 5.556497E-5 6.240264E-5 6.887021E-5 7.594283E-5 8.573439E-5 9.387098E-5 1.043915E-4 1.124593E-4 1.197339E-4 1.279183E-4 1.354084E-4 1.461932E-4 1.538931E-4 1.651730E-4
[1, 0, 0]
1.807781E-5 5.000255E-1 1.000027E+0 1.500037E+0 1.999949E+0 2.500271E+0 3.000421E+0 3.500245E+0 4.000430E+0 4.500535E+0 5.000175E+0 5.500297E+0 6.000461E+0 6.500278E+0 7.000404E+0 7.500422E+0 8.000130E+0 8.500298E+0 9.000405E+0 9.500260E+0 1.000041E+1 1.050045E+1 1.100027E+1 1.150046E+1 1.200063E+1 1.250040E+1 1.300039E+1 1.350042E+1 1.400053E+1 1.450025E+1 1.500037E+1 1.550034E+1 1.599990E+1 1.649987E+1 1.699999E+1 1.749969E+1 1.799975E+1 1.849973E+1 1.899940E+1 1.949960E+1 1.999973E+1
2.644519E-6 3.255839E-6 3.885260E-6 4.551087E-6 5.404635E-6 6.237661E-6 7.212324E-6 8.441468E-6 9.699202E-6 1.120446E-5 1.281600E-5 1.454438E-5 1.698139E-5 1.918288E-5 2.294977E-5 2.652749E-5 3.116230E-5 3.473689E-5 4.021199E-5 4.673059E-5 5.309726E-5 6.178728E-5 7.098754E-5 8.085509E-5 9.039426E-5 1.014126E-4 1.121298E-4 1.260864E-4 1.380002E-4 1.492319E-4 1.601667E-4 1.704910E-4 1.821883E-4 1.920405E-4 1.989216E-4 2.114975E-4 2.168152E-4 2.251409E-4 2.267554E-4 2.336190E-4 2.458172E-4

 

 

I can work with this format by writing a matlab script to detect the occurrence of [x,0,0] 3D array specifications. But I would much rather have what I want above (just from a simplicity standpoint).

0 Kudos
Message 1 of 3
(2,494 Views)

Most likely you will need to create a new 2D array and then take the data coming in and place it into columns in the 2D array

 

Use the array functions

 

Each time new data arrives place it in the next available column in the 2D array.

 

OR.. I completely misunderstand your Q.

HEh

 

 

 

0 Kudos
Message 2 of 3
(2,473 Views)
Solution
Accepted by topic author m-s

I found the solution on my own, but thanks.

 

What I did was to put the array into a shift register and wired the incoming data into the Insert into Array VI. That prevents the dimension from increasing.

 

To save it to a file, I used the Write to Spreadsheet VI with the transpose array input set to true (its row-wise otherwise).

0 Kudos
Message 3 of 3
(2,455 Views)