LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refresh display

Hello,

My question is very simple.
how can I refresh a numeric indicator every one second if it's inside a loop which iterates with different time?

Thanks ,

   Martin
0 Kudos
Message 1 of 7
(3,503 Views)

I assume you mean the loop iteration is faster than 1s, otherwise there is no point to it.

You can place the indicator in a case structure which will only execute when a timer crosses 1s. You can use the Elapsed Time express VI to see how this can be done. The timer can auto reset whenever it times out.

BTW, why do you want to update the numeric only once a second? Updating it faster shouldn't cause any serious performance hit. Is it because updating it too quickly means that you can't see it?


___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(3,497 Views)

Yes, the loop iterates faster than 1S

I want to update the indicator every 1S to make it "appealing to the view".

Thanks tst .

Message Edited by Martincho on 08-10-2005 06:23 PM

0 Kudos
Message 3 of 7
(3,486 Views)
Several ways to do this.

One: place the indicator in its own 1s loop and linking it to the data in the other loop using local variables. The easiest.

Two: as above: write code inside the loop that determines when a socond has passed, before writing to the indicator. little messier. Can be done nicely inside a subvi, though.

Three: There is this neat little VI server property node called defer front panel updates, stopping all front panel elements from being updated until you enable it again. Never used it myself, but it could be useful for you.

four: etc.
0 Kudos
Message 4 of 7
(3,478 Views)
I should get a job..
I thought it would be interesting to try the "defer front panel" property, so I made a little sample app and it works. Now I realize it would have been good for some of my work in the past, when panel updates were taking significant CPU resources (so far I was just hiding them with tab pages). Nice from this example is that it is very easily embedded into a subvi. For your particular application it is definitely not the most efficient solution, though.



VI source (labview 7.1)

0 Kudos
Message 5 of 7
(3,474 Views)

Thanks aartjan.

0 Kudos
Message 6 of 7
(3,455 Views)
It might be better to put the wait 1000 function in a separate frame between the Defer = True and the Defer = False frames. As you have it shown you do not know whether LabVIEW's scheduler will cause the Wait or the Defer to run first because there is no data dependecy between them.

Lynn
0 Kudos
Message 7 of 7
(3,451 Views)