0

I have a sub-vi that takes in 2 controls. First is a file path, identifying where to save a file to, and the second is a Waveform Chart control, that is the graph I want to print. I can save the image in the sub-vi using an invoke node, but the problem is, it isn't preserving the title,x, and y axis labels and other settings from what I passed in to the sub vi.

I also tried passing in as a reference, but was not sucesfful. Is there a way to save a graph as PNG in a sub vi, if the labels and other settings are set in the main VI?

Stealth Rabbi
  • 10,156
  • 22
  • 100
  • 176

2 Answers2

0

The answer is to pass in a reference to the sub-vi. The sub-vi must use an invoke node, but not be bound to an actual control, so it uses the actual reference passed in, not the reference to the FP control.

Stealth Rabbi
  • 10,156
  • 22
  • 100
  • 176
  • that's not very clear to me, the invoke node must be connected to the FP control or not? what is the "actual reference"? – CharlesB Sep 11 '12 at 20:07
  • 2
    Originally, he used a chart control on the connector pane of the subVI, but this only passes in the value of the control. The answer refers to changing the data type used in the connector pane from a chart control to a reference to a chart control and then passing the reference to the original control into the subVI and wiring that reference into the invoke node. This makes the invoke node operate on the original chart. – Yair Sep 12 '12 at 06:05
0

First off, you want to use the Export Image invoke node, not Get Image.

Also, If you right click on the invoke node in the sub-vi, you can disconnect it from the control it is bound to. Then connect the reference wire from the terminal connection of the subvi to the invoke node.

Keep in mind, you may need to programatically set the axis labels with property nodes before the export invoke node is called, depending on how your setting up the chart in the calling vi

Jonathan
  • 1,498
  • 2
  • 20
  • 41