03-29-2015 10:20 AM
A simple VI to convert a string into a dot matrix text display (XY graph) worked fine initially. After seemingly minor cleanup in the block diagram, the text jitters back and forth during updates (see attached vi). A subtle error is suspected. Help would be appreciated.
03-29-2015 01:12 PM
I couldn't figure out what exactly was going on, but if you defer FP updates before you start and turn on FP updates after then you can get rid of the jitter.
03-29-2015 01:51 PM - edited 03-29-2015 01:55 PM
Also, are you using run continuously? Try putting a while loop around your code. You can also use a value change event and set the string to update value while typing. And as was mentioned, defer updates as the code executes.
Edit: Just some feedback, you could simplify your array constant also, by subtracting 33 from the ascii value before indexing, and then get rid of all those empty array elements at the beginning of the cluster constant.
03-29-2015 02:19 PM
First, your vi has no loop, so typing text into the box does nothing until you run it. If you are running it with the 'Run Continuously' button then I suggest you put a loop in instead.
Second, you change the x.scale.min every time a character is typed, forcing the graph to redraw itself each time, and it is this redrawing that I think you see as jitter. I changed the numbers so the scale min is constantly zero and the 'jitter' goes away. See attached.
03-29-2015 11:37 PM - edited 03-29-2015 11:41 PM
The help of all people who replied is much appreciated. Alas, the info about defer FP updates in zone.ni.com is rather sketchy. Via which menus can this property be found, to try it out?
The example solution vi in one of the replies does not run on my "old" LV 2009, which is all I have.
The million dollar question remains: my first attempt worked perfectly (rock solid display when updating), so how could minor changes have "damaged" it?
03-30-2015 01:26 AM - edited 03-30-2015 01:26 AM
attached in LV9...
Defer Panel Updates is a property of the panel - drop a vi reference and a couple of property nodes on the form - example in the attached vi.
The million dollar question cannot be answered if we dont know what the (not so) minor changes were! However, since the observed jitter is a consequence of the graph being redrawn across video frames refreshes, it does not take much to change the timing of the program to mess this up. Even with your original example, is sometimes 'jittered' and sometimes didnt on my machine, and likely would have been different on other machines. The FP Defer Updates guarantees this won't happen (thanks @Jacobson) (my changes to the redrawing of the axes just reduces the work done in the redraw and helps matters, but wouldn't guarantee success)
03-30-2015 01:51 AM
Ah, the free property to reference bug ... oh well.
Just adding a loop and a small wait seems to calm things down, i tried with 100ms, and didn't see any jitter then, but it could feel slightly sluggish if you're writing fast. At 33 (30 fps) or 40 (25 fps) it jittered some, at 50 (20 fps) it was rare for me.
Some testing shows it's the XY graph resizing that's the issue, if you set it to a fixed size you wont get an issue. If you dont change the minimum scale it wont be much issue. Look at this slight modification, instead of using negative coordinates i subtract the minimum, normalizing it to 0+ so i dont have to change the minimum scale. I haven't seen a single glitch this way.
/Y