LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving chart data into a spreadsheet and also displaying it onto a table

Look man it works just fine on my PC. You don't need to look at the whole code just the section relating to the problem I am having which is updating values onto a table and saving it into an excel file. It may take you 2 minutes to do whatever it is you suggested I do, but I am starting from scratch and doing the best I can. Even though I took a class in Labview the professor was a moron and left things up to us to figure out and we didn't even come close to what I am doing for my project.

Please elaborate on your comment regarding "basic decency rules," "OP,"  "2 minutes to create a stamp-sized example," and "0 screens full of unintelligible code"
0 Kudos
Message 11 of 21
(2,513 Views)
1024x768

Regular 14"~15" Laptop LCD.

NI should spend more time fixing this problem as I had a similar problem when presenting a small project to a class where I developed the vi on a different computer and used another with a projector and things were out of place.
0 Kudos
Message 12 of 21
(2,519 Views)
OK,

Attached is a new VI which fixes the problems.

1.  The table is not replicating entries.  You are looking at data every 500ms.  The date time string you are using has 1s accuracy.  So, since you are sampling 2x a sec, it's going to round the time value.

2.  You need a shift register for your other table.

3.  You specified two spaces as your delimiter.  Excel would have to import this as fixed width and is probably doing the default of trying to import as delimited.  I placed a tab as your delimiter, and it should import correctly.

As an aside, you are not accurately saving time date in that output file.  You are assuming even intervals and aren't basing it off of the time delay you have.  I haven't changed anything there.  You assumed that data points are spaced 1s apart.

You can use the write to spreadheet file and just feed your table into the input.  The table already has dates and values in it.  You should also realize that your timestamps are off by your sampling delay since LabVIEW will get the date/time while you are waiting.

You also have the potential of saving bad data since you process the data even if nothing has come into the serial port since you last looked at it.
0 Kudos
Message 13 of 21
(2,494 Views)

Mrjazzitup wrote: 1024x768

Mine is 1400x1050, so there is clearly a bug in the windows scaling if you use that odd option to maintain aspect ratio.

Dennis gave you all the advice you need, but there are many other aspects to your code that would benefit from some simple detailing. I am sure your diagram could be simplified dramatically without any loss in functionality.

You seem to overestimate our capabilities. Your diagram is 2x5 screens big (10 screens!) and to look at a diagram written by somebody else, where I have no idea what it is supposed to do and what the reason is for each wire is is not trivial. First I need to endlessly scroll back and forth to follow wires, then probably triple-click a few to see where they go. Look at the picture below! I challenge any LabVIEW guru to immediately tell me what's connected to where and where the hidden wires go. (for example which of the three boolean wires in the bottom right connects to what terminal of the feedback node? :o).

 

 

For an example of code simplification, have a look at the "Rube" post taken from your code above.

LabVIEW is fun and easy and it should not take long to get the hang of it. I am sorry to hear that your teacher did not do a good job. Maybe you want to continue on your own and do some simpler fun program. If you get stuck, we will always be here to help. 🙂

Message Edited by altenbach on 09-14-2007 03:41 PM

0 Kudos
Message 15 of 21
(2,488 Views)
I tried linking the output of the table into the input of the Write to Spreadsheet file.vi and it does not work since they have incompatible data types.


Also If I wanted to use the History Node of the chart and input it into Write to Spreadsheet file.vi and preserve the current date and time how would I accomplish this, since this would be much easier than integrating the streams to Build a Waveform and then inputing into Export Waveform.
0 Kudos
Message 16 of 21
(2,470 Views)
The attached VI has the write to spreadsheet file.vi instead.


0 Kudos
Message 17 of 21
(2,466 Views)
It looks like there is an embedded vi that it is looking for but can't find. The vi is looking for Write to Spreadsheet File (string).vi
0 Kudos
Message 18 of 21
(2,444 Views)


@Mrjazzitup wrote:
It looks like there is an embedded vi that it is looking for but can't find. The vi is looking for Write to Spreadsheet File (string).vi

This is a VI that only exists in LabVIEW 8.2 or higher. You have LabVIEW 8.0 so this did cannot downconvert. (LabVIEW 8.2+ has a polymorphic VI selector for "write to spreadsheet file" that allows for an array of strings).

This is no big deal. Just convert your array of strings to a spreadsheet string using "Array to Spreadheet string" with %s as format (see image). Then write the resulting plain string to a file using e.g. "write text file". You will have the same result. 🙂


 

Message Edited by altenbach on 09-15-2007 02:33 AM

0 Kudos
Message 19 of 21
(2,438 Views)
Thank you all for your hard work. I will be spending some more time optimizing the system and hopefully I will master the skills needed to mentor other newbs like myself.


0 Kudos
Message 20 of 21
(2,399 Views)