LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Which is faster? Update Indicator vs. Data Check

In a case where an indicator may not change very often, is it faster to just keep updating the indicator with unchanged data, or check the data and update it only when it chages? I know the style guide says to do the later, but it seems like much more code is invloved (at least a shift register for each indicator, or something like the attached vi). Intuatively, it just doesn't seem like checking the data through everyt loop would be faster than replacing 37.2 with 37.2. Perhaps it's more important to do the data check with strings than it is with numbers?
On a similar note, the attached vi is something I use to check if data has changed (in this case a DBL).  Is this vi as fast and efficient as a shift register? It certainly is more convienent and less messy.
(the attached vi may look familiar to some, it was extracted from a vi in the OpenG toolset).


 

Richard






0 Kudos
Message 1 of 3
(2,574 Views)
You probably don't need to worry about micro-managing the update of simple indicators. By default, they are not set to "synchronous update", so FP updates are skipped anyway if they occur too rapidly. The update also occurs in the UI thread.
 
You might look into something like this if you are dealing with e.g. graph indicators containing huge arrays, are set to autoscaling, etc. In this case updates can be expensive.
 
Many times, your toplevel VI can use an event structure, so the loop spins and updates occur only if something changes. 🙂
Message 2 of 3
(2,568 Views)
Good point re: the default display mode of indicators. I have one X/Y chart that has a cluster of 15 DBLs (possibly up to 60 later). There's two arrays of other information @ 15 items each, and 3 or 4 more individual DBL indicators, a path indicator, and a few strings. I was wondering, with all these indicators, how much time I'm wasting updating the front panel. I guess I could profile the VI and find out.
Richard






0 Kudos
Message 3 of 3
(2,558 Views)