From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D array of floating point value to excel

Solved!
Go to solution

Hello,

I am trying to convert continuosly 1d array of multiple floating point values into excel sheet. Created excel sheet (by WriteToMeasurementFile) include multiple values from each cycle of performed loop, however all data are in one column. I want to export these values in sucha way that at each cycle multiple values will be created in new row, and each row will have time stamp from cycle where current values where been created.

 

Thanks in advance for any help,

Borsuk

0 Kudos
Message 1 of 8
(2,504 Views)

We cannot tell what you are doing wrong unless you show us your code. Please do. Thanks.

0 Kudos
Message 2 of 8
(2,464 Views)

Wild guess: You need to activate Transpose array on your Write to measurement file.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 8
(2,442 Views)

In properties of Write to measurment file Express Vi  I cannot find this option. Do I missed anything?

0 Kudos
Message 4 of 8
(2,391 Views)

Hi Borsuk,

 


@Borsuk wrote:

Do I missed anything?


Did you read message #2 carefully?

You have problems with your code, but you resist to show that code: how much help do you expect?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(2,388 Views)

Hi GerdW,

I am sorry, somehow I didn't noticed this message. Please find in attachment code and example of excel file with results. I suppose that solution is very simple. I am a beginner so please do not judge me 😄

 

Download All
0 Kudos
Message 6 of 8
(2,377 Views)
Solution
Accepted by topic author Borsuk

How tied in are you to Excel?  Do you really need an xlsx file or just something that can open in Excel?  My recommendation would be to format your data into a tab delimited text file.  You can open those very easily in Excel and it will format the way you want.  I say to do this because it will make your code A LOT more performant and you can also view your data in a simple text editor (ex: Notepad).

 

But you also made a deadly sin of editing global code.  Do NOT create projects in user.lib or edit the shipping driver.  Make a new project that calls the VIs from the driver.

EDIT: I just noticed I missed the operation input on the Open/Create/Replace File should be set to "replace or create".


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 8
(2,369 Views)

Sigh.  Another inexperienced LabVIEW user misled by Express VIs and the really-confusing Dynamic Data Wire (which, in my opinion, should be banned).

 

The Excel File was most revealing.  Did you notice that the "Time" values suggest that your data were sampled at 1 second intervals?  That (as you asked!) the Time was reset to "Time = 0" for all but the very first set of 3 values (and I'm not sure why that has actual Timestamp data)?  That you appear to be saving three values at a time (I'm assuming that you intend them to be columns, as in Channel 1, Channel 2, and Channel 3, but you don't provide enough detail about what you want to do for us to be sure), then three more, all in one column?

 

I'm guessing that each pass through the loop, you acquire 3 values.  The logical thing to do would be to write those three values, as text, in a line, perhaps separated by a comma (or a tab).  Such a (text) file could be read by Excel, which would recognize the separating comma or tab and make it an Excel table, even prompting you to save it as a true Excel (.xlsx) file.

 

If that's what you are doing,

  1. Get rid of the Convert to Dynamic Data function.
  2. Get rid of the Write to Measurement file.
  3. Learn how to do "ordinary" file I/O in LabVIEW.  You might look at the Write Delimited Spreadsheet file, which will put the commas or tabs in your data.

Bob Schor

 

 

 

 

0 Kudos
Message 8 of 8
(2,359 Views)