LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System table flickers

Solved!
Go to solution

Hi guys!

Just an easy question that you probably know how to fix, but for me this is giving me headacheSmiley Indifferent

 

I got just this very simple example based on my big program. I empties an 2D array, put something in the array, and displays it in a system table using shift register.

In my frontpanel everything goes as planed, but the table flickers. I have tried to put in longer delays, and the flickering stops around 4-5 seconds. Unfortunately this will interfere with the rest of my program. I cannot have 4-5 seconds of delay on each interation in the mainwhile loop, when I also wait for the user to click different buttons. The whole program will then be very "slow" to use.

Is it the place i put the table that makes this problem?

If you try my program, do you also see flickering? Maybe it's only my computer.

 

Created in LV2010 BDS.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 1 of 11
(4,172 Views)
Solution
Accepted by topic author EvenDeejay

I dont have 2010 on this PC but this might be an architecture question.  You should not rewite a table faster than the user needs to read it (1/sec maybe slower).  You should consider a state machine, and most likely an event based sm.  The table can be updated in a stae when new data is avaliable or when a certain timeout has occured. 

The simplist way to slow down a part of a loop (not most elegant though) is to put a case structure around the write and wire the boolean to an elapsed time vi.  This will not slow down your loop (probably speed it up infact) but would slow the table update down to a managle rate.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 11
(4,151 Views)

Even,

 

I do not see any flickering except on the first iteration where the table is empty and then replaced by the array.  The way your example is written I would not expect to see any ongoing flickering because nothing changes after that first iteration.  If you are seeing continuing flickering, it may well be something in your computer's graphics display.  Mac OS X 10.5.8, LV2010.

 

As Paul said it does not make sense to rewrite the same data to the screen repeatedly. You may want to consider using an event structure and only update the table when something actually changes.

 

Lynn

Message 3 of 11
(4,146 Views)

Hi guys:)

Thanks for the answers!

 

Yesterday after I posted this, the forum suddenly went down and I couldn't post anything more. You see, just after I posted it, I found a solution. As you're saying I should just update the table when something actually happens. So I put it inside a case-structure that the user activates to do stuff that actually writes to the table. So the table only updates once and not for every interation. Still the table flickers on my computer, but since that only occurs when the table is updated on every interation(which is bad coding), I don't care so much about it.

As for the statemachine, I'm still new to LabVIEW (only 6 months experience) and haven't had time to study so much at work, so I haven't really checked it out yet. But from what I've read here on the forum, the statemachine is the recommended structure to use.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 4 of 11
(4,122 Views)

I've only flicked through this thread very briefly so I may way off but it caught my eye as I've had similar problems. Could the solution be to defer Front Panel updates until all your data has been written and you're ready to re-draw your table? Just a thought. Apologies if I'm talking nonsense.

0 Kudos
Message 5 of 11
(4,085 Views)

I'm guessing that this is the same table flicker behavior on update that I noticed a few LabVIEW versions back, and I recall I even posted a bug report about... In fact I recall that the behavior was absent from 8.0, appeared in 8.2, and seems to be present a few releases since.  Interesting that someone running on a Mac doesn't see it, so it must be a "Windows thing".

 

Anyway, I came up with a simple workaround, but you won't believe me till you try this.  Drop a plain flat rectangular box (from the Decorations palette) onto the front panel, and resize it to some miniscule size.  Then drag it so that it sits over the table (I usually put it over that bottom-right area if the scrollbars are enabled).  For some reason only an R&D engineer at NI could explain (and none have), this makes the flickering stop.  Here's where it gets even better - don't like this little artifact on your table? Paint it transparent!  And the workaround still 'works'.

 

Go figure.

 

Hope this helps,

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 6 of 11
(4,071 Views)

Yes, the table flickers, because you are writing to it 200x per second, even though none of the data ever changes.

(Unlike graphs, tables don't have the smooth update option that does double buffering)

 

Why are you using a shift register? Since you never re-use the history, the shift register serves no function. (Of course maybe your real code is more complicated.... ;))

 

You should ensure that the table only updates whenever the data changes, so don't hammer it with identical data in rapid succession forever. Here's a quick draft...

 

Download All
Message 7 of 11
(4,062 Views)

 


Anyway, I came up with a simple workaround, but you won't believe me till you try this.  Drop a plain flat rectangular box (from the Decorations palette) onto the front panel, and resize it to some miniscule size.  Then drag it so that it sits over the table (I usually put it over that bottom-right area if the scrollbars are enabled).  For some reason only an R&D engineer at NI could explain (and none have), this makes the flickering stop.  Here's where it gets even better - don't like this little artifact on your table? Paint it transparent!  And the workaround still 'works'.


 

Thanks for that tip!

 

I didnt believe it but its true, the flickering stops. (my table on a different problem only updates 4 times per sec, but i still had the flickering.) a transparent rectangle completely eliminates flickering.. O.o i have no idea how you figured that one out, but thanks a lot. 🙂 My guess would be Labview uses some sort of Buffer for drawing the objects, and having some ontop of each other might force it to draw only when the top-most object is calculated/done.

Message 8 of 11
(3,652 Views)

Nice tip!

 

The flickering bothers me quite a bit! Even slow updates to a table can cause visible flickering and this clears it. Excellent!

 

 

0 Kudos
Message 9 of 11
(3,560 Views)

I wouldn't have believed it either, but this transparent recatangle totally did the trick to remove the table flicker.  THANK YOU!!!

 

I'm updating a table with CAN data every 100 ms and it was flickering like crazy, each update did indeed include new data.

 

 

Edit:  One negative impact about this transparent rectangle solution is that now the user can not select any of the table data for cut/paste because of the rectangular overlay.

 

Edit 2:  If you change the size of the rectangle to not "cover" the left most column, it will allow the user to select that column and then drag to select whatever data they may need to copy.

0 Kudos
Message 10 of 11
(3,228 Views)