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: 

Write string columns to Spreadsheet

Solved!
Go to solution

Hi,

I have problem.

 

I have a device which generates 3 data, eg. voltage, current, frequency.

When I run the program, all values are put under him, but I would like to were in the 3 columns.

For example:

Voltage      Current   Frequency

2                 1               5

4                  4              5

5                  3              6

 

The second problem is related when i run program continously. Values are not added to the column but overwritten.

 

save.jpg

 

What do I need to change the program to act as my premise?

 

Regards

0 Kudos
Message 1 of 7
(5,222 Views)
Solution
Accepted by topic author piotrek1349

Don't use Save Spreadsheet String, but use the Write Delimited Spreadsheet function from the File I/O Palette.  Incidentally, I hope you realize that "Spreadsheet" in "LabVIEW-Speak" means "A text file where data are arranged in rows (with New Lines) and columns (with some to-be-specified separator character).  It does not mean "An Excel .xls or .xlsx file".

 

Bob Schor

Message 2 of 7
(5,216 Views)
Solution
Accepted by topic author piotrek1349

Yer doin' it wrong...

 

First write your column headers to the file ONCE at the beginning.

 

Then write your numeric values in ROWS as a single demention array

========================
=== Engineer Ambiguously ===
========================
Message 3 of 7
(5,205 Views)

Ok,

 

First problem solved:) Thanks!

 

But,

How to add next values to the spreadsheet when i run program continously?

At this moment the values are overwritten.

save.jpg

0 Kudos
Message 4 of 7
(5,192 Views)
Solution
Accepted by topic author piotrek1349

Use a loop

 

loop.PNG

========================
=== Engineer Ambiguously ===
========================
Message 5 of 7
(5,185 Views)

how are you writing your row of strings in the first array? 

I do not understand where you get that string format of many columns from? 

0 Kudos
Message 6 of 7
(3,338 Views)

Hi lodhi,

 


@lodhi33 wrote:

I do not understand where you get that string format of many columns from? 


When you write "columns" you should think of "array"!

Use a string array constant…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(3,330 Views)