LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange LegPlots bug for greater than 761 graphs

See attached VI.
 
I'm seeing a strange bug. I generate random data to plot on an XY graph. I have quite a few plots (greater that 800 sometimes). The VI shows the problem and gives instructions to duplicate. After wiring the graphs to the XY graph, I set plot parameters such as color and name. To do this, you first call Active Plots. Now, if Legend: Plots Shown property is not explicitly set to the number of plots, and you try to access a plot with Active PLot, an error 1077 will be thrown (see this forum). So for graphs less than 762, you can change to any number and then set LegPlots to that number and set the parameters with Active Plot, etc. However, if you change to a number greater than 761, Active Plot will throw an error. I think it is because LegPlots isn't changed for some reason. Its important that this only happens when Defer Front Panel Updates is on. If you set it to false, it will work as expected. Unfortunately, for the program I use this for I need to Defer the Updates, or else the draws for each graph take a long time (you see graph by graph being drawn). Another interesting thing is if you set Graphs to a number higher than 762, and stop the program on the error, then run the program with the same parameters it works fine.
 
In summary, when using Defer Front Panel Updates, for increasing the number of plots shown everything works IF you do not increase beyond 761. Legend: Plots Shown does not store the correct value.
 
If someone could run the VI for a sanity check, and perhaps give a good workaround, or show where I have gone wrong, I would appreciate it.
 
Michael
0 Kudos
Message 1 of 6
(3,133 Views)
I can confirm the operation in LabVIEW 8.2. I don't know that it's an issue of it not storing the right number. It just looks like that property has a maximum value of 761. If you add a "Read" operation to occur after writing to it, it shows that whenever you try to write a value greater than 761, the "Read" always returns 761. This may simply be a built-in fixed limit. Don't have 8.5 so I can't test it there.

Do you really need to show that many plots at once? I would think the information displayed is a little overwhelming.
Message 2 of 6
(3,116 Views)
Michael,

I don't know if this solution will work, but I am not seeing redraw problems from it.

I set the defer panel Updates AFTER setting the LegPlots value, then went through the ActivePlot loop and received no errors.  I used 1000 plots with 10000 data points, and did not see any individual plot redrawing.

My guess is that the Front Panel update is delaying the Legend Update, whcich explains why it works the second time around - when you turn the updates back on, the legend gets updated.

For what it's worth, it appears this problem is fixed in 8.5.  I do not even need to resize the legend.
Message 3 of 6
(3,114 Views)

>>If you add a "Read" operation to occur after writing to it, it shows that whenever you try to write a value greater than 761, the "Read" always returns 761. This may simply be a built-in fixed limit.

You're absolutely right. I'm still a little puzzled why then the second run it works. Matthew, I can't quite get your suggestion of moving the Defer FP Updates to work (I'm using 8.2.1) Do you mind posting?

>>For what it's worth, it appears this problem is fixed in 8.5

*sigh*, someday...

>>Do you really need to show that many plots at once?

Not usually, but sometimes its useful. Especially when the boss wants itSmiley Wink

Michael

0 Kudos
Message 4 of 6
(3,096 Views)

This was reported to R&D (# 4EHCL05M) and was fixed in LabVIEW (8.5). Here is a link to the current evaluation software download for LabVIEW. Thanks!

 
0 Kudos
Message 6 of 6
(3,064 Views)