01-05-2006 10:14 AM
I'm never keen on parrallel loops and local variables - it can be a clumbsy solution, particularly in such as small job.
Here's my solution - pop this VI in front of your numeric indicator, and wire in your chosen update interval (milliseconds).
A five star solution I reckon?
Mark.
01-05-2006 10:48 AM - edited 01-05-2006 10:48 AM
Message Edited by altenbach on 01-05-2006 08:51 AM
01-05-2006 12:24 PM
01-05-2006 12:31 PM
OK, this makes more sense 🙂
However, be aware that the slow indicator STILL gets "updated" at the fast rate (= with every iteration of the loop!), just with a stale value most of the time. ;).
01-05-2006 01:10 PM
@altenbach wrote:
However, be aware that the slow indicator STILL gets "updated" at the fast rate (= with every iteration of the loop!), just with a stale value most of the time. ;).
Of course - but that's no different to writing the value to the local variable in the "parallel loop/local variable" method - the second loop may run slower but the fast loop is still writing values to the local variable at the fast rate.
It's worth pointing out (as I'm sure you yourself are aware) that the LabVIEW user interface will not "physically" update an indicator display (i.e. rewrite a numeric, or redraw a plot, etc) unless its value has changed.
Also, another thing worth a mention - by default, the LabVIEW user interface runs asynchronously to the user code (unless you explicitly set it to be synchronous); so for example, if you have an unrestricted loop write an incrementing value to a numeric indicator, the display is only going to be updating say 25 times a second (guessing the probable rate) even though the incrementing value itself will be able to reach 10's of millions (for example) of increments in the same time period.
01-06-2006 02:54 AM
@Mark H wrote:
It's worth pointing out (as I'm sure you yourself are aware) that the LabVIEW user interface will not "physically" update an indicator display (i.e. rewrite a numeric, or redraw a plot, etc) unless its value has changed.
This might be true (and I'm not sure it is), but there is a clear benefit NOT to place the indicator terminal in the code path. There is definitely cost involved, even if it is only the checking if the data has changed or not 😉
In the attached example (LabVIEW 7.1), the graph ALWAYS gets the same data, yet having the terminal in the code path slows down the execution time significantly.
Sure, it typically is not worth bothering, but this is something to keep in mind if there is a lot of data involved. (In your case, you could add a "data changed" boolean output to your subVI.) 🙂
And YES, I agree that the earlier solutions by others using local variables are not that great.
01-06-2006 06:14 AM - edited 01-06-2006 06:14 AM
@altenbach wrote:
@Mark H wrote:
...the LabVIEW user interface will not "physically" update an indicator display (i.e. rewrite a numeric, or redraw a plot, etc) unless its value has changed.
This might be true (and I'm not sure it is), but ....
Message Edited by Mark H on 01-06-2006 06:19 AM
01-06-2006 09:43 AM