11-09-2013 11:22 AM - edited 11-09-2013 11:29 AM
Yes, there is definitely a bug here (tested in LabVIEW 2012 and 2013). (reported here)
I eliminated all that extra baggage (e.g. also writing to the minor increments, etc.)
I was able to eliminate the problem for the Y scale, but the x-scale still showed the problem. However, I found that if you write the increment, then read it out in the same property node, the problem does not occur. Even if I now remove that new read property again, the problem is fixed. Go figure. 😮
Attached are two simplified versions of the VI. (1) demonstrates the problem clearly.
(1) sets the X-increment once outside the loop (it should never change anyway!), but checks the increment after each write in the loop. The Loop terminates early because the x-increment suddenly changes for no good reason at all.
To demonstrate the problem, run it several times. It will alternately stop at iteration 0 or 7 instead of completing the FOR loop normally.
(2) Set everything inside the loop, and read out the increment. Now everything works correctly.
11-09-2013 02:04 PM
After running altenbach's VIs, I see the effect now on the Mac version. It is in Cameron's original VI as well. I just was not looking at the right (or wrong) things. So my comments about the OS were not valid.
Lynn
11-11-2013 08:00 AM
Thanks, altenbach. I had added the minor increment nodes in there just to make sure I was covering all the bases I could find. Now, there's something you have in your VI that I didn't know about. If you set up a "Value" (write to) property node to your graph, then wire your X and Y data to it, it updates your graph itself, IIUC. Cool. This looks like it should make a bunch of things doable (or at least more readable on the BD) than I had thought possible.
Cameron
BTW, if I remember right, you're a physicist - and physicists work with unusual number series more than most chemists. Anything come to mind with the series of offending array input positions (1, 7, 31, 96, and 318)? Just wondering.
11-11-2013 10:04 AM
@camerond wrote:
Now, there's something you have in your VI that I didn't know about. If you set up a "Value" (write to) property node to your graph, then wire your X and Y data to it, it updates your graph itself, IIUC. Cool. This looks like it should make a bunch of things doable (or at least more readable on the BD) than I had thought possible.
I was doing that mostly to play with execution order. Property nodes execute top to bottom, so instead of using complicated sequence structures for testing as proposed by others here, you can write the value at the beginning or the end of the property node. (Turns out that it does not make a difference for this bug.).
One thing to remember is that property nodes execute synchronously and (if performance matters) writing to the terminal is orders of magnitude more efficient (in this case it is microseconds vs. milliseconds). However here you are writing to a property node anyway so it does not really add that much. I typically place property nodes inside a case structure and call them only if the inputs actually change.
Writing to a value property node is also less convenient at edit time, because it does not automatically adapt to the datatype. XY graphs take a variety of datatypes (I typically prefer complex arrays), but if you change the type wired to the value property node, you get a broken wire until you also temporarily wire the same new datatype to the xy graph terminal directly.
Also note that in this particular example the x-axis is spaced equally and all you need is a plain waveform graph with the correct x0 and dx. (See also this comment). Simpler code!
11-23-2018 03:49 AM
05-21-2019 09:24 AM
I'm also currently using LV 2018.
Altenbach's solution did not work for me, but when I right-clicked the plot, then went to "advanced", and then unchecked "auto adjust scales" everything was better.
The error is (at least in part) generated by the width of the labels for the y-plot. When, for example, the maximum length of a label on the y-plot jumps up (or down) by one character (say, the plot minimum changes from -90 to -100), the plot area itself is reduced to make space for the extra character. This happens even if you resize the plot area so that there is enough room for the extra wide plot labels. I could see this happen by eye, and I verified it with the "Plot Area:Size:Width" property.
05-22-2019 12:45 AM
@pogo wrote:
I'm also currently using LV 2018.
Altenbach's solution did not work for me...
Well, it turned out that it didn't work well enough for me. I still had issues with the scale sometimes. Doing the trick several times made it better. I ended up having to do the trick in the timeout loop of an event structure since there was no event to trigger on where the trick worked well enough. It looks bad that the scale flickers but it was acceptable.
03-18-2020 09:04 PM
First of all you change all the value related to X and Y axis except Xscale.incrment, after this
you have to change Xscale.incrment (always at the end).