11-05-2014 03:48 PM
Hi,
I am using the Labview for a quite long time. recently i found out that screen updates slows down the code excecution. is there any way that i can eliminate the delay that i am getting because of the screen updaes or changes?
Solved! Go to Solution.
11-05-2014 04:20 PM
Maybe.
Without knowoing more about how your program is designed, it is hard to give specific advice.
Look at the Producer/Consumer archtecture. This uses parallel loops to isolate slow activities from more time-critical ones. The basic concept is that things which need to be fast are put in the Producer loop while things which may take longer or things which are not adversely affected by extra delay are put in the Consumer loop.
In a typical program which includes data acquisition (possibly at high rates), display of data on the front panel, and saving data to files the data acquisition is in the Producer loop. The data is enqueued as soon as it is read. Nothing else is in that loop. The Consumer loop dequeues the data and places it in a shift register buffer. At time scales appropriate to users (a few times per second) the front panel is updated. Similarly data is written to files when a suitable size chunk has been accumulated (~64 kB on many systems) or a time interval has elapsed.
Lynn
11-05-2014 04:47 PM
Also make sure you don't have a lot of front panel objects on top of each other (even just at the corners). I understand this causes LV to spend a lot of extra cycles trying to figure out what thing is actually visible.
If you're having issues and it's slowing down a critical process you could try deferring panel updates. Hard to say without more information.
11-05-2014 07:18 PM
Why wouldn't that cause some delay? Drawing something on the screen will always require some computation time.
If you want to get around it, there's two realistic options: look at the code and determine if you really need to be updating things like you are now. It's possible you're updating indicators that you don't really care about. Do you have controls that could be constants?
Zwired mentioned deferring updates. You can use a Property Node to defer the front panel updates. Set it to true, run some code, set it to false. Everything is computed by nothing is updated until the false is read into the Property Node.
11-05-2014 09:24 PM
Way it was explained to me was for each indicator that is involved in an ovelap has to figure out whether the image portion is on "top" (and visible) or not. It's not as simple as eveythign drawing on the screen every time and whoever is on top "wins" and is visible.
In trying to find a definitive explanation I ran across this. Seems like a reasonably comprehensive list of things to check, in lieu of information from OP.
11-05-2014 09:40 PM
@Zwired1 wrote:
Way it was explained to me was for each indicator that is involved in an ovelap has to figure out whether the image portion is on "top" (and visible) or not. It's not as simple as eveythign drawing on the screen every time and whoever is on top "wins" and is visible.
In trying to find a definitive explanation I ran across this. Seems like a reasonably comprehensive list of things to check, in lieu of information from OP.
Nice start to your homework
The easy explaination is: If objects overlap they all need to be redrawn whenever any of them are redrawn.
11-06-2014 11:14 AM
I dont know which property node to use to defer the front panel updates.
11-06-2014 12:28 PM
Go to View >> Class Browser
Pick all classes in VI server library and search for panel.
The property is Defer Panel Updates and is part of the Panel class.
11-06-2014 12:57 PM - edited 11-06-2014 01:07 PM
@dmoradi wrote:
Hi,
I am using the Labview for a quite long time. recently i found out that screen updates slows down the code excecution. is there any way that i can eliminate the delay that i am getting because of the screen updates or changes?
Your question is really way too generic to give a clear answer. You already got qute a few hints at various aspects, but I think you need to define the problem in much more detail before we can give a solution.
Can you show us some code?
11-06-2014 10:38 PM
Hi,
thnak you very much for the very specific question that you are asking about my problem. and here are some answers:
I have a couple of while loops and I measure the time intervals between each execution.
i am using a Tab control to organize my controls and indicators, when i select the tab that has more indicators and are changing frequently, I can see that measured time goes for axample from 10 ms to 100 ms.
I dont have graphs, but I have 1 dimentional arrays with 1000 elements. i dont have overlapping elements.
without screen updates delay (when the front panel is in a page with no indicator to change) is about 2-3 ms
all of them are using normal priority
I think so, for this project I have used lots of property nodes to read and write to variables.