LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NXG XY Graph - Possible inconsistencies with property nodes

Solved!
Go to solution

First, I'd like to share that I've only completed core 1 and 2.  Never had any programming experience before that.

 

Hello, I am having issues trying to programmatically change properties on an xy graph using multiple plots.  

 

Current issue I am trying to resolve:

When I select 1 or 2 files to plot, it works fine.  If I select 3 or more, I get an error.

 

Summary of my code (pictures at the bottom):

1) Placed an NXG style XY Graph on my front panel.

2) Used a File Dialog express VI for users to select 1 or more files to plot.

3) Ran array of paths into a For Loop.

4) Inserted code to pull data out of each file and bundle it for the xy graph within the loop.

5) Inserted property nodes to change behavior and displayed information on the xy graph within the same loop.

 

My thoughts:

-The Legend seems to not work as I expect it.  I would expect for the Legend to clear all of its entries/plot names when I reinitialize the xy graph.  The traces on the graph clears but the information in the Legen does not.  Is my issue related to this...?  

-When I tried to use the "Plot Visibility Checkbox" property (manually and programmatically), the errors started to occur.  I also noticed when running in Highlight Execution mode and Plot Visibility Checkbox turned ON, the legend appears to create space holders for "possible incoming plots"...but the checkboxes are off..?  I wondered if this had something to do with my original issue...so I left it turned off for now.

-I also read that I needed to set the "IgnoreAttributes" property to TRUE if I wanted to change the plot names.  So, I tried setting everything in one property node within the loop.  After having those errors, I thought maybe I needed to better define the sequence to some of those properties.  Hence the stacked sequence structure.  

 

FarmerJ_0-1698072280314.png

FarmerJ_1-1698072332170.png

FarmerJ_2-1698072365637.png

 

 

0 Kudos
Message 1 of 9
(735 Views)
Solution
Accepted by topic author FarmerJ

Sorry, we don't do "pictures" of LabVIEW code. Please attach your VI instead and maybe a few simple data files.

 

Is your problem specific to the NXG style graph or does the problem exists for all styles?

 

(After core 1&2, you should know that "index array" is resizeable. No need for multiple instances. You should also know to avoid stacked sequences. You cannot set a property for a plot that does not exist, so make sure to plot all before setting properties.)

Message 2 of 9
(723 Views)

I can't debug a picture but it kinda sounds like this ancient issue:

 

https://forums.ni.com/t5/LabVIEW/How-to-remove-entries-from-the-plot-legend/td-p/946939

 

(BTW, use File-  Save for Previous and backsave to 2019 or 2020. Not everyone has 2023 installed, assuming that's what you're using.)

0 Kudos
Message 3 of 9
(713 Views)

AltenBach,

 

Thanks for replying.  I just replaced my NXG style xy graph for a Modern style xy graph.  It gets the same error (1077 Active Plot). 

 

I see in parentheses, you noted that "index array" is resizable.  I knew that, but I'm not understanding what you mean by "No need for multiple instances".  Are you referring to the property nodes?  My thought was that perhaps the Ignore Attributes needed to be set before the Plot Name property.  I originally had all properties set in one instance. But changed it after some troubleshooting.  

 

Mentioning to plot before setting the properties turned on a light!  I can't believe that I didn't think of that one.  I just had it in my head that the property is being set to the graph, not individual plots.  I'm going to pull the property nodes out of the For Loop and set them after plots are done.  

0 Kudos
Message 4 of 9
(708 Views)

See if this can give you some ideas. You are doing way too many things.

 

altenbach_0-1698075493209.png

 

0 Kudos
Message 5 of 9
(706 Views)

@FarmerJ wrote:

see in parentheses, you noted that "index array" is resizable.  I knew that, but I'm not understanding what you mean by "No need for multiple instances".  


A picture says it all

 

altenbach_0-1698075832428.png

 


@FarmerJ wrote:

My thought was that perhaps the Ignore Attributes needed to be set before the Plot Name property.  I originally had all properties set in one instance. .  


"Ignore attributes" is completely pointless because you have plain arrays, not waveform or dynamic data. Did you look at the help?

 

 

0 Kudos
Message 6 of 9
(695 Views)

Whoa, hold your horses Altenback.  I'm not a LabVIEW Champion.  Give me a few minutes to fix this code and then I'll address my reasoning for the multiple instances.  Most likely answer is just inexperience.  I'm only given two official days in the week to help code in LV.  I know I have a lot to learn and obsessed over learning more.  

0 Kudos
Message 7 of 9
(684 Views)

Thanks BertMcMahan.  I didn't think anyone would bother to look into debugging actual VI's.  I will include a VI going forward to any help I may ask on here.

 

I am currently using LV2021.  I'm trying to make a change to the code right now based off of a suggestion given already.  

0 Kudos
Message 8 of 9
(675 Views)

Making sure the plots were all done before changing the properties worked.  I removed those property nodes from that For Loop.  

 

That picture does say it all.  You're right.  I don't know why I ended up with two instances of Index Array.  I corrected it in my code.  This was my first time trying to use an XY Graph and to be honest, I struggled to grasp the concept of how to use it for multiple plots.  I spent a lot of time last Friday on this.  

 

I did see the note about using Ignore Attributes for Waveform or Dynamic Data, but I just didn't trust the information to be honest.  I tried using it anyway hoping it was a typo or a bug...and to find a fix in desperation for my issue.  

0 Kudos
Message 9 of 9
(656 Views)