Jump to content

Scale Increment and the case of the marching plot area


mje

Recommended Posts

I've had a standing defect on one of our products for a few years now where under some situations one of our plots would slowly march off screen on each window resize event. Well I finally tracked this one down. Attached is code to reproduce (LV 2013).

 

Plot area.vi

 

If you open the VI and run it, then proceed to do multiple window resize events you'll notice the left edge of the plot area slowly marches over. My recommendation is to maximize/restore/repeat a few times to see the effect. Take for example this series of images:

 

post-11742-0-50554200-1379450755.png

post-11742-0-01351200-1379450768.png

post-11742-0-89662100-1379450781.png

post-11742-0-33049200-1379450798.png

 

The offending code is simple, I'm setting the scale increment on a resize event:

 

post-11742-0-14787900-1379450867.png

 

If the VI is edited such that the property node is removed the behavior vanishes. I wouldn't expect setting this property to cause the issue, I think I smell a bug in here somewhere. Confirmation?

Link to comment

I'm just glad we can identify what's causing the issue. Hard to create work-arounds if you don't even know what to work around. I imagine manually setting the scale marker values array may fix the problem (then again it may also trigger it just the same). Rendering grid lines manually via the plot image layers also comes to mind if one doesn't want a grid at each division.

 

Reported to R&D with CAR 427628.

Link to comment
  • 1 year later...
  • 2 months later...

Just found this post this morning. We have this erratic behavior also in my code in LV2014. We discovered it last month on our project. I spent some time investigating it this morning and found the following:

  • XScale-Increment appears to have nothing to do wit it
  • The fact that you "Autoscale with Pane" has no effect either has our property node "Width" & "Height" produce the same effect
  • In our case, we do not use the "Increment" property so the problem generally has to do with the Y-Scale in general
  • After a resize to a larger window, LabVIEW appears "resize the graph" (shrink on the left hand side) automatically to fit the scale with higher accuracy (let's say 0.25 increment instead of 1). When you force the increment back to 1, LabVIEW seems to return the graph to where it used to be but in the process, it seems to me that LV alters some reference it uses as to the real "X-origin" of the Scale. When you do the process multiple times, it keeps shifting the scale further left.
  • After some thinking, I thought it might be possible to force the graph to move the other way if the problem was the one I suggested and it actually worked. Look at the attached file.

Is there any way to report this to NI to associate it with the right CAR?

 

Did anyone found a real practical solution to the problem? In our case, I plan to change using the VI to loading a clone so if the display gets messed up, we'll have a "reload" button from the unmodified original vi.

Plot area_OriginalPost.vi

Link to comment

In the end I sidestepped the bug by turning off "Advanced>>Auto Adjust Scales†on all my graphs.  

 

Yes, this works. It does however also mean the graph doesn't behave well as font settings are changed. But LabVIEW in general is pretty pathetic at scaling with font settings so it's not like that behavior is out of place.

Link to comment
  • 1 month later...

Oh yah, I definitely see this bug on LV 8.51 on Win7 x64 (development) and WinXP (target). Remarkably, it's the first bug I've run into in LV and I've been coding since LV 6.1. (Perhaps it's because I have basic needs!) Here's my work around: First, I do a "Advanced | Reset scale layout" at design time. Then, with just the single scale on the left due to the reset, I add my second scale. It appears on the left. Then, (with "Advanced | Auto adjust scales" still enabled), I click on the scale I want on the right and select "Swap Sides". (This option is grayed out if "Auto adjust scales" is disabled.) So, now I've got two scales set up on the left and right. At this point, I do another "Advanced | Auto adjust scales" to uncheck this feature. Now, I can turn on or off either, or both scales, change formats, etc. and the plot area does not change. Of course, I'm left with some rather broad margins on the left and right edges (if both scales are turned off). But that's a small price to pay for a work around that doesn't make me write any code.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.