LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data spreadsheet formatting

Hi all,

The problem I'm having seems to be a simple one.

I have an array that writes to a spreadsheet data file, and hte resulting output is somethign like this:

Date: 06/27/05
Time: 15:21:49
0.124500
Date: 06/27/05
Time: 15:21:59
0.415156
Date: 06/27/05
Time: 15:22:05
0.841440
Date: 06/27/05
Time: 15:22:05
0.719489

Since I don't have labview 7.0, I don't have "write to excel sub-vi". So what I would like to do is to be able to copy this into excel so as to have somethign that looks like this:

Date/Time : | Random number | Random number 2 |random number 3 (to be replaced by some DAQ input)

in short... it would be best if I could have my data output such as:


Date: 06/27/05 Date: 06/27/05 etc...
Time: 15:21:49 Time: 15:21:59 etc...
0.124500 0.415156 etc...

I tried transposing the array etc...but it doesnt seem to have any effect.

please help, any suggestions is appreciated.

thanks a lot
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 1 of 19
(2,927 Views)
I have 7.1, so I couldn't make a vi, but here's a picture that obtains the data in the format you want. Then just write the array to a spreadsheet file (not to excel) if that's available. Otherwise, use what you used (I didn't have the sub vi in your vi).

Hope this helps,

Geoff
Message 2 of 19
(2,921 Views)
Hey novatron.

thanks for the quick answer, but it doesnt really work. I don't understand how to implement the loop into my program...

re-uploaded program
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 3 of 19
(2,919 Views)
Hi Aquaphire,

I think you need to enable indexing on the tunnels on the while loop. Right click on the tunnels and select "enable indexing".

-poswal
0 Kudos
Message 4 of 19
(2,907 Views)
I guess I'm not sure why you need to have the "modifiedwritestringtospreadsheet" inside the loop. Why not just gather all the data, then dump it out? I can't look at the sub vi, since it wasn't included, but is there a reason that you need to write to the file real time? Or is that sub vi storing the array for later writing to a file?
0 Kudos
Message 5 of 19
(2,906 Views)
i have a meeting, ill continue this post tomorrow, thanks all.
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 6 of 19
(2,905 Views)
Hi Aquaphire,

I'm not sure I understand why you want to store the data in a horizontal direction, but anyway - because it is a bit harder than doing it the vertical way, I have created a small example that shows the way to do it:



I also attached the data.xls file that was stored from the VI - just so you can compare it with what you wanted.

Have fun!

Message Edited by Philip C. on 06-29-2005 02:29 AM

- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
Download All
Message 7 of 19
(2,885 Views)
Hey phillip,

I tried integrating your loop into my example, and came up with 2 problems.

1. Everytime the loop re-runs "at the press of a button", it creates a new file even after I'd created a shift register.

2. The format of my xls file comes out all screwy! Instead of being like yours, its like this:

Date:6/29/2005
Time:10:27:20 AM
0.238936 Date:6/29/2005
Time:10:27:23 AM
0.163435 Date:6/29/2005
Time:10:27:26 AM
0.546501 Date:6/29/2005
Time:10:27:27 AM
0.388554


I tried fiddling aroudn with the "new lines" and all, but it didnt seem to change anything. Hmm, here's my VI
thanks
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 8 of 19
(2,860 Views)
After having fiddled aroudn with the program I still havent managed to reformat it.
For anyone else that comes upon this thread, what I'm trying to do is reformat data into a horizontal arrangement like:

Date:6/29/2005 Date:6/29/2005 Date:6/29/2005
Time:11:17:04 AM Time:11:17:04 AM Time:11:17:04 AM
0.93136 0.977973 0.630199

So while writing to a spreadsheet, the "tab" would enable the moving of the columns (A-> B->C)

I would like to this this because I will want to add different inputs like pressure/strain... And if it were all in one row, it would be easier to graph out.

The data does NOT have to be gathered in real time, but I don't see how it could be gathered otherwise.. any help is appreciated. thanks
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 9 of 19
(2,843 Views)
Aquaphire,

I would like to this this because I will want to add different inputs like pressure/strain... And if it were all in one row, it would be easier to graph out.
Are you talking about graphing in Excel? It's really not clear to me (a longtime column user) how/where using rows rather than columns makes things easier. But if that's what you're after …

1. Everytime the loop re-runs "at the press of a button", it creates a new file even after I'd created a shift register.
You needed to run a wire connecting the shift register for the path thru the false case. The tunnel was set up to 'Use default If Unwired' and the default is an empty path.

2. The format of my xls file comes out all screwy!
Screwy is what you get because you're appending Date_Time_Number to Date_Time_Number which gives Date_Time_Number_Date_Time_Number. That's appending.
What you want is a lot of string insertions to give Date_Date_Time_Time_etc. This tends to get messy fast.

A couple of mods (v6.1) to your VI are attached which hopefully may give you ideas.
Mod1 writes in your desired format when the VI finishes.
Mod2 writes in columns "at the press of a button" and then transposes to your desired rows when the VI ends.

Message Edited by Donald on 06-29-2005 12:55 PM

=====================================================
Fading out. " ... J. Arthur Rank on gong."
Download All
Message 10 of 19
(2,836 Views)