LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d data(string) to excel

Dear users of Labview,

Sinds a week or 2 I'm working with labview. I'm used to work with C++ Builder 6.0 so this is a complete other way to program. I'm working on a project that can read/write measurements from a multimeter and a Powersupply. I can read and write to both devices.
I want to write some data into an excel file. The first column I want to fill with the time and the second column I want to write fill with the measurement. In this way I can see on what time a measurement has been taken.

I can write the output values of the multimeter into an excel sheet but I can't fill 2 rows at the same time. I'm trying to use an 2D array en this is working but I can't write an 2d (string) array to excel.

Can somebody tell me how to write an 2d string array to excel ?

I'm using Labview 6.0.2 (yes I know there is a new version :D)

Thank you for you're time and efforts.

IJnte de Jong(Netherlands).
Press "F" to format your disk, or "F" to cancel.
0 Kudos
Message 1 of 5
(3,458 Views)
Hi.

When you are writing data that you then want to open in Excel (or any other spreadsheet program), columns are separated by tabs, and rows by end-of-line constants. Therefore, if you want to write two columns and two rows at the same time, you simply need to build a string that contains the appropriate number of tabs and end-of-line constants in the right places.

For example, you would use the code depicted in the attached picture to write 2 rows, each with the time in the first column, voltage levels of the power supply on the second column, and dmm measurements on the third column.

With each iteration of the while loop, you would write to the file 2 rows, with 3 columns each. (it would seem more natural to write one row at a time, but you mentioned that you wanted to write 2 rows each time). Of course, you would put your real data where I have put random numbers.

Hope this helps.

Alejandro
Message 2 of 5
(3,447 Views)
Thnx! This works very good. I only have one problem... The program that i'm making runs continuesly. So what I need to do is:
1). Open the file.
2). Write the new (2) vallues in in, Time & Voltage.
3). Close the file.

When I use the "Open/Create/Replace File.vi" to open the Excel sheet i'm overwritting the old vallue. When I open the file once and not close it, there are a lot of strange characters in my excel sheet. I don't know how I can get rid of these characters?! It looks like this:
%#$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%5[Sheet1]2#$$$$$$$$$$$$$$$$$$$$$

Does anybody knows what I'm doing wrong?
Press "F" to format your disk, or "F" to cancel.
0 Kudos
Message 3 of 5
(3,429 Views)
Try wiring 1 into the pos mode input of the write VI. This is supposed to make the VI write at the end of the file.

___________________
Try to take over the world!
Message 4 of 5
(3,420 Views)
Thnx!! It works now. Thank you for you're time!
Press "F" to format your disk, or "F" to cancel.
0 Kudos
Message 5 of 5
(3,395 Views)