LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting data to be presentable when Excel opens

I am trending tag data on an XY Graph and would like the option of exporting the trend data to an Excel File which opens and displays the data when a boolean control is pressed. It is important that the data is shown with timestamp and tag headings in the excel file, if possible, like this:

Date & Time                   Tag Name 1                           Tag Name 2

10/11/05 10:39               10.1                                       50.0

10/11/05 10:45               10.2                                       50.5

11/11/05 13:09               11.1                                       60.0

I am experiencing difficulty making this possible. Firstly, I get a "File not in recognisable format" when I write the data to an excel file. And secondly, when I close excel and return to my vi, I get the following error message highlighting my Close Reference function:

LabVIEW: File permission error

NI-488: DMA hardware error detected

If anyone can help me open excel to show the correct data in the correct format (above) I would be u-n-b-e-l-i-e-v-a-b-l-y grateful! I have attached my vi which should show what I am trying to achieve.

Many thanks for any help with this,

Best regards,

Stuart

0 Kudos
Message 1 of 8
(3,346 Views)
Hi Stuart
 
Could you post your vi as LV7.0?
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 8
(3,331 Views)
Hi Thomas, Same file saved as LV 7.0 thanks for taking the time to have a look, Stuart
0 Kudos
Message 3 of 8
(3,328 Views)
Hi Stuart
 
What I saw first is, that you destroyed the excel- and workbook-references in a very strange order, without closing or quitting them. So if you don't close all references properly, you might have problems accessing the file.
 
Attached is a simple example I've just made. Have a look at it, I think this is helpful for you.
 
Thomas

Message Edited by becktho on 11-10-2005 01:40 PM

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 8
(3,318 Views)
Thanks Thomas, although i would like to leave excel open if possible.  The user of this program will press the boolean switch when he/she wants an excel file of what they see on the XY Graph.  Excel will then open with the data arranged in nicely headed columns (associated with the tag name) and excel will stay open, like a pop up, until the user saves the file to a destination of their choice and closes the excel file themselves.
 
Is there anyway my code can be altered to:
 
1) call and open excel
2) display the data in XY Graph in headed columns in the newly opened excel file
 
I am totally stumped with this one - any help here would be a lifesaver!
 
thanks for your continuing support,
 
Stuart
0 Kudos
Message 5 of 8
(3,309 Views)
Hi Stuart
 
Yes it is no problem to leave excel open. Just don't close workbook and excel and don't destroy the references right after opening excel (e.g. you can do this if the user pushes a button). Attached is a new version of my earlier vi.
 
On how to display the data as graph, start a new thread as I'm not so into this topic.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 6 of 8
(3,308 Views)
Thanks Thomas, out of all the examples and threads i've trawled through that vi is the most applicable. I do have a couple of questions though... In the case of my vi, can i simply hook my values from the XY Graph property node into the Obtain Queue function?? Also, the user of this vi will have no LV experience so i'm trying to make it as simple as possible - do i have to use 3 boolean commands (generate, open, close) to write a file each time? Can this be simplified to one control? Sincere thanks for all your help so far. regards, STuart
0 Kudos
Message 7 of 8
(3,292 Views)
Hi Stuart
 
Nice to hear that I could help you up to now.
 

In the case of my vi, can i simply hook my values from the XY Graph property node into the Obtain Queue function??

I repost the vi with some additionaly comments. Hope this makes the topic "producer / consumer" design-pattern a little bit easier to understand for you. If this pattern is new to you, maybe the following links could help you:
 

do i have to use 3 boolean commands (generate, open, close) to write a file each time? Can this be simplified to one control?
No, of course you do not have to use three booleans. This was just meant to show you, that it is possible to keep excel open. You could close excel in a "exit"-case (which should be executed if the vi is stopped) as well.
 
I hope this helps you again to move a step (or hopefully more) forward.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,280 Views)