LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What may cause jitter in a graph?

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.

0 Kudos
Message 1 of 7
(2,930 Views)

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.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 7
(2,895 Views)

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.

0 Kudos
Message 3 of 7
(2,884 Views)

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.

0 Kudos
Message 4 of 7
(2,876 Views)

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?

 

0 Kudos
Message 5 of 7
(2,854 Views)

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)

0 Kudos
Message 6 of 7
(2,837 Views)

Ah, the free property to reference bug ... oh well.

StrToDot.png

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.

StrToDot2.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(2,826 Views)