LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY Plot legend positioning

Thanks Bowen, sounds like fun 🙂

 

@girish, post your actual code and I'll look. I can't debug a picture very well. What you have looks close so it's probably just a typing issue.

0 Kudos
Message 21 of 27
(671 Views)

@girish53

 

My apologies, there was a side conversation going on with BertMcMahan and it was rude of us to highjack your thread for it. Even if I were able to provide the code for what I shared above, it is likely more complex than you should be incorporating into your program.

 

The error you have in your subVI is a "Wire Class Conflict". There are some under the hood reasons this is happening but we don't need to dig into that now.

 

The fastest way to fix it will be:

  1. In your main VI, right click on your reference to "mntr1graph" and select "Create Constant"
  2. Right click on that constant and "Change to Control"
  3. Copy that control into the sub VI and use it as the reference input instead of the "XY Graph" reference you used.

 

This should fix your problem.

0 Kudos
Message 22 of 27
(667 Views)

Problems. When I right clicked on the reference and created a constant, it named it mntr1graph 2. Then I copied the control in the subvi and connected to it. Here is how it looks

girish53_4-1675107618808.png in the main VI, and in the subvi

girish53_1-1675106871023.png

The old reference is not connected to anything. When I run, I get this error

girish53_2-1675107072988.png

I hit continue. The programs seems to work but the legend is not where I expected.

girish53_3-1675107221370.png

I am still not there.

Thank you. 

Girish

 

 

0 Kudos
Message 23 of 27
(656 Views)

You're close!

 

You're feeding the constant into your sub VI. Feed the actual reference instead (the one in your main VI with mntr1graph label).

 

Creating the constant was just a convenient way to get a reference of the proper type.

0 Kudos
Message 24 of 27
(654 Views)

Yeah, that did it. Thank you very much for your help and patience. 

Girish

0 Kudos
Message 25 of 27
(637 Views)

More than a month ago you had showed me how to position a legend. The procedure worked perfectly. Now I have a vi with multiple xy graphs. Right now I have to create a new subvi to position the legend for each graph. Is there a way to create just one subvi to position a legend given reference to any xy graph? When I try to use the subvi for a graph different from what was used in creating it, positioning does not work. The underlying graph objects have the same class. So why is the subvi tied to a specific graph instance? 

Thank you. 

Girish

0 Kudos
Message 26 of 27
(563 Views)

@girish53 wrote:

 When I try to use the subvi for a graph different from what was used in creating it, positioning does not work.


What happens? Can you share your code?

0 Kudos
Message 27 of 27
(555 Views)