12-21-2015 03:48 PM - edited 12-21-2015 03:48 PM
Is it possible to insert an apended image from an XY graph into a excel template? If it is possible, I figure that it would be easier to do that instead of inserting data that transforms into a graph given my current setup.
Thanks!
-I
12-21-2015 06:23 PM
Maybe a year or two ago, I posted a Revised Example to show how to use the Report Generation Toolkit to make an Excel Workbook. It included saving the data in Excel, and making an Excel graph. It was very simple, very quick, got all of the data together in a single Workbook, and if you found out later that the third point should have been (3.5, 4.6) instead of (4.6, 3.5), you can simply open the Workbook, make the change in Excel, and the (Excel) Graph will fix itself.
I suspect this is far easier than trying to embed a LabVIEW Graph (as a "Picture?") into Excel.
Bob Schor
12-21-2015 06:51 PM
IEvo8 a écrit :
Is it possible to insert an apended image from an XY graph into a excel template? If it is possible, I figure that it would be easier to do that instead of inserting data that transforms into a graph given my current setup.
Thanks!
-I
Yes it is possible and it's even very easy if you use the Append Control Image to Report VI from the Report Generation palette, have a look at the help file for this vi. But as Bob suggested it might be a better idea to save the data in Excel if you want to do further analysis.
Ben64
12-22-2015 06:32 AM - edited 12-22-2015 06:36 AM
I failed to mention that some of the data plotted on my graph that doesn't need to be listed in columns has around 32k points, will that cause issue?
I'll take a look at your history and see if I can find your example.
Thanks,
-I
12-22-2015 07:36 AM
32K points is a whole lot of points to put on a graph -- it seems to me likely to "overwhelm" the ability of the graph to display meaningful data. It's sort of like making a chart that plots data at 1KHz, far faster than the eye can resolve. Both problems can be solved by decimating the data -- average 10 to 100 points at a time, and plot the averages. In the case of discrete points (such as you have), that brings the number of points to plot to 320 - 3200, while for sampling, 10 - 100 points/second.
To find my earlier example, type "Revised " (the space after "Revised" is important) in the Search box in the upper right and choose what pops up.
Bob Schor
12-22-2015 08:25 AM
Normally you wouldn't be wrong, but the amount of data was requested to be left raw.
Anyway, I was able to find some resources that helped. That and Ben64's comment. I attached the .vi that's able to pull data and the control image straight to excel.
Thanks everyone for your help!
-I
12-22-2015 08:50 AM
I like your use of the RGT to insert the LabVIEW image into your Workbook. However, you can do much better than using a Stacked Sequence. What you have is basically a State Machine with three States, call them 0, 1, and 2. Replace the Stacked Sequence with a For Loop with an "N" of 3, inside of which is a Case Statement wired to the Index with three Cases -- 0, 1, and "2, Default". Create Shift Registers to hold the values for Degrees, X, Y, and Data (thereby getting rid of the Dreaded Local Variables) and "tap into" them when you need to use the values.
If you are really adventurous, create an Enum with values "Initialization", "Create Data", and "Save in Excel". Replace the For Loop with a While Loop, add a "State" Shift Register that is wired to the Case (which will then take on exactly the three values of the Enum) and wire "Initialization" to the input side of the While Loop's State Shift Register. At the end of the Initialization case, wire Create Data to the State Shift Register (on the right edge of the While Loop), and at the end of Create Data, wire "Save in Excel". Finally, in the Save in Excel State, wire a True to the Stop Indicator of the While loop.
Notice that using Enums gives your State Machine some "self-documenting" features -- the Initialization State is "labelled" by having the Case say "Initialization", for example.
By doing this, you (a) get rid of the dreaded Stacked Sequence and Local Variables, (b) get more "self-documented" code, and (c) use a Design Pattern that other LabVIEW users will (one hopes) instantly recognize and understand.
Bob Schor
12-22-2015 01:37 PM
I didn't think about using a for loop to control an enum, that's a great idea! Thanks!