LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I copy a reference?

ok, i'll spill the beans. hahha

 

 

Graph one is living in the parent vi

 

graph two is living in the child vi

 

 

Name of the child vi = create image from graph 

it accomplishs the same thing as export image, BUT does not require the vi to be open.

 

This can be accomplished by the method Get Image

 

however, export image is really pretty, it has a white background, the frame is white, etc etc.

 

However, i need to make changes to the graph,

size (optomize for printing a full page)

back ground color color

legend location

frame color

width of the plot lines

 

 

the best way to do this while still preserving all other settings is to use a reference to pass the original graph 1 into the subvi as a reference.  BUT if this is done, i can't make changes to the reference property nodes because it will change the parent.  SO a copy has to be made.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 11 of 15
(1,318 Views)

Pass the reference to both graphs to whichever VI is doing the work of changing properties.

 

If you want to change a property for both graphs, then make that change to both graphs using the reference to each graph.  If you only want to change one of the graphs, then only write the changes using that reference.  When you write data to a graph, then you can use a property node to write to the value property.

 

If you put the reference to each graph in an array, then you can wrap the property node in a For Loop with the array of references autoindexed so the loop will run twice, once for each reference.

0 Kudos
Message 12 of 15
(1,314 Views)

I only start with one graph in the parent vi.......only one reference......I need to create a second graph in the subvi which is identical but has a different reference.

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 13 of 15
(1,305 Views)

The sub-VI can look like this

 

Copy_With_ref.PNG

 

BUT

 

this is not copying the refs but using two refs to control from and to...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 14 of 15
(1,300 Views)

You say "create a graph" in second VI, but that graph in reality already exists, correct?

 

How are you opening/loading the second VI?  If the second VI is in memory, you ought to be able to grab a reference to that graph.

 

Take a look at Ben's nugget on using control references.  http://forums.ni.com/t5/LabVIEW/Nugget-Using-control-references/m-p/570756

Message 15 of 15
(1,297 Views)