LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving an XY graph

Solved!
Go to solution

This is something I haven't done before in LabVIEW, though it seems like it should be pretty simple... I am just not quite sure where to start.

 

I am used to saving my data as text files using the write to measurement file express.vi and the write to spreadsheet.vi, but now I have an XY graph that I want to save.  What is the name of the .vi I use to do this and what kind of options do I have for file format and such, do I just save it as a .jpeg or some other image file, or is there a .vi that will save both the image and the data? 

 

Thanks for the help!

0 Kudos
Message 1 of 8
(10,096 Views)

Hi Lars,

 

maybe you should tell us, what you really want to save into a file!

 

I guess you only need to save the data. As the XY graph is composed of (atleast) 2 arrays you simple need to save those two arrays in the same way as you did before. I would suggest using WriteToSpreadsheetFile to save a 2D array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(10,095 Views)

I plan on saving the data as well, but I really would like to save the graph as an image file so that the tech who will be running this test does not have to go back and re-create it.  The test is for a calibration certificate, so I will need both, and would like to make the life of the cal-tech easier if I can.

 

I attached an image of the block diagram.

0 Kudos
Message 3 of 8
(10,086 Views)
Solution
Accepted by topic author LarsUlrich

LarsUlrich,

 

It sounds from the format options you mentioned you would like to save a picture.

 

1. Right click on your graph on the BD.

2. Select "Create>Invoke Node>Get Image

3. Wire the newly created Invoke Node to "Write to PNG" sub-vi (found under "Graphics & Sound>Graphics Format" in Functions Palette)

 

-Chazzzmd

Message 4 of 8
(10,084 Views)

Thanks Chaz, that was exactly what I needed.

0 Kudos
Message 5 of 8
(10,079 Views)

Hello there!

 

 

Thanks for the advice - this is exactly the problem that I am currently having. Unfortunately, when I right-click my x-y chart, the ' create' menu does not seem to have an 'invike node' option. I am currently running LabVIEW 2011 - do you think that might be the cause?

 


Regards,

 

Euan

0 Kudos
Message 6 of 8
(9,918 Views)

Hi Euan,

 

yes, it has. Right-click the terminal in the block diagram -> create -> invoke node -> ...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(9,916 Views)

Ah!

 

 

Thanks very much for your response GerdW - I couldn't see it on my block diagram, but when I right-click on the chart in the front panel it gives me the option to invoke node.

 

 

Many thanks!

 

Euan

0 Kudos
Message 8 of 8
(9,914 Views)