LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Life size plotting of XY data

Hi,

We have a system that does surface scan of components to generate cross section profile. The width and height data is then shown on an XY graph. On the XY graph, X-axis represents width of a component and Y-axis represents gauge (or thickness). We take this graph as .jpg into our MS Word report (attached as "TEST REPORT.doc").

From the report it can be seen that the cross section profile has been made to fit the graph area (and thus it is not 1:1 size of the component under test).

Our question: How do we take a life size printout of this data. In the attached example, the component is nearly 225mm wide and max height is upto 13mm.

We are using LV 7.1 with Report Generation Toolkit and Database Connectivity Toolkit. OS is Win2000 Prof.

An early answer will be appreciated.

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 1 of 8
(3,121 Views)
There are two components to this problem - the LabVIEW side and the Word side.

On the LabVIEW side, you can get the right aspect ratio (so your bitmap is correct) by using the Plot Area>>Size property to change the graph area size before you take the bitmap snapshot. You should save as a PNG, not a JPG, if possible, to prevent graphical artifacts. JPG is not suitable for line drawings. You should not see much, if any, size increase in the bitmap.

I do not have any experience with the LabVIEW report generation toolkit (are you using this?). However, in Word, you will need to correctly scale your drawing so that it is the actual size. If you consistently have the same scaling in LabVIEW, this should be a fixed scaling coefficient (e.g. 123.5%). You can probably create a macro to do this automatically.
Message 2 of 8
(3,066 Views)
DFGray,

Thanks for the reply.

I am not sure whether you've understood me correctly. My on-screen display (of which I take a JPG snapshot CANNOT be 1:1 because then it will not fit on the screen!

What I would like to happen is that LabVIEW interprets my X and Y-data in the correct units. This is something that happens in drawing softwares like say AutoCAD which allow you to plot a component in life size.
Thus a component that has been scanned to reveal a width of 410 mm should be printed on paper such that print size is 410mm.

The component size (in my case) can vary from 6mm to 600mm. Thus I cannot have a constant scaling factor.

Please let me know if I have understood your answer wrongly or you are still not clear on what I want.

Yes, we are using the report generation toolkit.

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 3 of 8
(3,057 Views)
I realized that you cannot get the full size on the LabVIEW screen. All you should do in LabVIEW is get the aspect ratio (X to Y pixel width ratio) correct so that the final graphic can be scaled easily in Word. As you mention, due to your size range, you will need a variable scaling factor. You can compute this easily enough knowing the pixels/inch value of the LabVIEW graph. However, as I said before, the LabVIEW to Word end of this is not my area of expertise. I will try to find someone who can answer that part for you.
0 Kudos
Message 4 of 8
(3,043 Views)
You can use the Word Format Picture.vi in the Report Generation Toolkit to scale an image you have just added to the report. I have attached a screenshot of my VI block diagram below that shows how to do this. You can follow the previously-given advice on how to calculate the appropriate scale factor based on pixels vs. actual size, then you can use the calculated scaling factor as the "scale factor" input to this VI.

Good luck,
-D
Message 5 of 8
(3,031 Views)
Hello Gurdas,

I would also suggest using the Insert Word Graph vi to send your graph to the Word document. This vi allows you to set the size of the graph in either inches or centimeters for how it will appear in the Word document. This will only set the size in the Word document so you can still keep the original graph size in LabVIEW. The vi has an input for graph size that takes a cluster of the height and width of the graph. You can set the units of these values with the input Measurement System in the same vi. You wire a constant 0 if you want it in inches and a 1 if you want it in centimeters. Therefore, you can use the max and min values of your graph as the inputs to the graph size. This will result in a graph that is to scale. You also will not have to work with pixels or scaling since LabVIEW will handle all of this for you.

Thanks,
Caroline
National Instruments
Thanks,
Caroline Tipton
Data Management Product Manager
National Instruments
0 Kudos
Message 6 of 8
(3,011 Views)
Gray, Darren and Caroline,

Thanks for your help and sorry about reverting so late. Was caught-up in project delivery (which happened today) and travel.

I have not tried Caroline's suggestion and will do so today. However, I found that any resizing of the graph gives poor results. The pixel get stretched and lose clarity (like when we see an image at 200%). Let me know if there is a better way out.
does your answer ensure high-fidelity print?

Also, how do I resize the page itself to accomodate a large print? The current size is set to A3 but this will need to be changed whenever a larger and A3 component had to be printed. If I do not resize the page, the word report cuts the image to fit the current page size.

Looking forward to your help.

Thanks,
Gurdas
Gurdas Sandhu, Ph.D.
ORISE Research Fellow at US EPA
0 Kudos
Message 7 of 8
(2,982 Views)
You are not limited to your screen size when you resize the graph for export. Determine how many pixels wide and high you want your final plot on the page (look at your printer resolution), then set the graph that size. Grab the image and post it to Word. The attached VI shows the first part of this process by saving a PNG of a simple sine wave at a size larger than most screen resolutions (3000x1500). In use, I did not see the graph resize, but the image was the correct size. My screen resolution was 2560x1024 (dual monitor) when I did the test.

Good luck.
0 Kudos
Message 8 of 8
(2,957 Views)