LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3d array write to measurement file

Hi,

I have some data that's a sequential stack of numbers. Its a 3D array that gets generated out of a for loop.

Now I am having trouble in writing that data in Excel. I want the data to be stacked in columns, one adjoining the other.

I have looked at this page, tried the approach suggested by Dennis but it did not work out.

https://forums.ni.com/t5/LabVIEW/How-to-write-a-3D-array-to-file-spreadsheet-and-read-it-back/td-p/2... anyone point me towards any examples/ code that accomplishes this sort of thing?

0 Kudos
Message 1 of 7
(3,802 Views)

fixed link

 

Post your vi with some sample data


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(3,768 Views)

I have some questions.

  • You talk about Excel.  Do you mean the program Excel, written by Microsoft as part of its Office Suite, that uses a proprietary .xls or .xlsx file structure?  The alternative is what LabVIEW calls a "Delimited Spreadsheet File", often written with the extension .csv (for Comma-Separated Values) as an ordinary text file.
  • You say you want to "write that (3D) data in Excel".  Excel (Microsoft) writes rows and columns, and can have multiple Sheets.  Do you mean for two of the dimensions to be rows and columns, with the third being different Sheets?
  • If you mean something else, please explain how you intend to "map" the three dimensions (let's call them Rows, Columns, and Pages) into whatever structure you envision.  I don't understand what you mean by "data stacked in columns, one adjoining the other".

Bob Schor

0 Kudos
Message 3 of 7
(3,747 Views)

Hi Jeff,

Please see the attached sample VI. How do you create a mechanism in which I find multiple data sets (corresponding to the first index in this VI) written adjoining each other in a MS Excel program? I have used the Write to Measurement file within the second loop that makes the different data points stack one on top of the other. Is there any way to put them in a series of columns?

The actual code I am working on is a computer vision algorithm which has output from a subVI (in its own loop) and that has to be concatenated with an array from a for loop in the main VI that creates a 3D array.

0 Kudos
Message 4 of 7
(3,722 Views)

Hi Bob, Thanks for replying.

  • The program I want the output to be in is Microsoft Excel.
  • What I mean by writing 3D data in excel is the question of how to wire a 3D array output to a "Write to measurement file" VI which by default only accepts 2D data as input.
  • I get a series of x,y,z values out of a computer vision algorithm I developed. So lets say in the first iteration I have a 2D array of these values; in the next iteration I would have a different set. Thus, I envision the mapping this way: These values that get generated (3 columns in each iteration) should be stacked adjoining one another, and thus I would obtain the point cloud information corresponding to a time-step.

 

0 Kudos
Message 5 of 7
(3,719 Views)

Something like this?

Capture.PNG

Message 6 of 7
(3,714 Views)

StephenD showed you how to change a 3D array of 3x3xmany into a 2D array of (3*many)x3 array (the third-dimension's 2D arrays are stacked vertically).

 

If you have the Report Generation Toolkit, generating an Excel .xlsx file containing such a 2D array is very simple.  You use New Report (specifying Excel), an Excel Easy Table (with the 2D array wired to its 2D input), Save Report to File (to which you've wired the path to the .xlsx file you want to create -- don't forget its extension) and Dispose Report (to close Excel).

 

Bob Schor

0 Kudos
Message 7 of 7
(3,699 Views)