LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

chart in excel sheet

Hiii,
I want draw the chart in the excel sheet without using report generation tool kit . i have the sensor data w.r.t. time in the excel sheeet as shown below
 
Time Temperature
4/12/2007 1:55 PM 153
4/12/2007 1:55 PM 152
4/12/2007 1:55 PM 151
4/12/2007 1:55 PM 150
4/12/2007 1:55 PM 149
4/12/2007 1:55 PM 148
4/12/2007 1:55 PM 147
4/12/2007 1:55 PM 126
4/12/2007 1:55 PM 127
4/12/2007 1:55 PM 128
4/12/2007 1:55 PM 129
4/12/2007 1:55 PM 130

i have tried some of the example given in the discussion forum but its not giving the right range

Rgrds

HKT

0 Kudos
Message 1 of 10
(4,359 Views)
You need to explain your problem a little better. Are you saying your data is in an actual Excel workbook, and you're trying to read the contents out of the workbook? Or is the data being generated by your program and you're saving to Excel? What do you mean "it's not giving the right range"? What range? Is this a cell range? A numeric range? What are you using to plot?
0 Kudos
Message 2 of 10
(4,340 Views)
Hi,

I am reading sensor data & converting it into real world unit (like temperature value to degree celsius).

I have 2D array of string having tempeaure & time value from the application

i am saving this data into particular excel sheet & i am trying to make the chart by reading the content from the excel sheet

but i have both the option
  1. i can read the content from excel
  2. or i can directly use 2D array of string.

    i am unable to make the chart using activex control in excel sheet

Rgrds
HKT
0 Kudos
Message 3 of 10
(4,329 Views)
OK, that's more clear. It sounds like the issue is with Excel, rather than LabVIEW. It's possible it has to do with the time data all being the same. You mentioned having a range issue. That could be related. You probably need to include seconds in your time data. Can you post your VI?
 
Also, have you considered just doing the plot using the LabVIEW plots? It fairly easy to do, and is more reliable since you're not dealing with an external operation (Excel). Attached is a simple VI that graphs your data, though I had to change the time data to generate a trend. Since you said you are getting strings the time string needs to be parsed to generate a time stamp, but that's fairly easy to do.
0 Kudos
Message 4 of 10
(4,301 Views)

Good advice from smercurio.

I do have a couple of questions: 

1.  Where does the graph have to appear?  Is it in a LV VI or within the Excel application? It sounded like the LV VI, but I am not sure.

2.  What is the sampling rate of the temperature?  It appears that the temperature was dropping at a rate of 1deg / 5 sec. (or 0.2 deg/sec) based on 12 samples shown within the same minute (don't know the duration of 12 samples).

3.  Why are you storing data to Excel?  (not a bad way, I do it myself..  just curious as there may be other alternatives)

JLV

 

Message 5 of 10
(4,293 Views)
There is also a couple more things you can do to make it easier on the "code"
 
  1. Create a template in excel.
  2. in excel record a macro of you creating the chart and formatting it as you wish.
  3. save the template.
  4. In LV open the template and save your data there and then run the macro on the data and save it under a new name.

For more information and some sample VI's and tool kits, you can go to the excel board




Joe.
"NOTHING IS EVER EASY"
Message 6 of 10
(4,281 Views)
well said Joe!
Message 7 of 10
(4,271 Views)
thks to all for the valueable comments
 
let me explain my application more, to clear the concept of using excel in this particular application
 
I am storing the data(time/temp) in the binary format on the hard disk.
 
the excel part comes when user want to have the excel report for its analysis .
 
that is user can use the data but soring it in the excel (format i have shown) as well as chart ( for better visualization)
 
the first part(insert data into excel sheet)  i have made using activex control but in the scond part( insert chart into excelsheet) when i give the range specifed in the excelsheet it give me the error 3008
 
it is better to make chart by using 2D array of string but i am unable to find the result for the same
 
VI is attached with this reply
 
 
0 Kudos
Message 8 of 10
(4,264 Views)
the excelsheet which is generated by the labview having the sensor data is attached
 
I am trying to make the chart of these different sensor data showm in the excel sheet
 
Rgrds
HKT
 
 
 
0 Kudos
Message 9 of 10
(4,258 Views)

Again I cannot stress enough the need for you to create a macro in the template and make the macro do all the work. You can also find a VI for handling charts in one of the toolkits that is posted on the excel board.

For more information and some sample VI's and tool kits, you can go to the excel board




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 10
(4,243 Views)