There are some subtle differences that are detailed here.
The property node allows the reading and writing of a single control within a cluster whereas a local variable and
terminal will always refer to the entire cluster. A property node can update the value from a remote location, not
on the diagram associated with the panel. If you are using a non-strict control reference, then the datatype of the value may be a variant rather than the actual datatype of the control.
Due to these differences, there are also some performance differences. If updating something like a graph, you
would sometimes need to position two cursors, change some colors, and write the data to the graph. In the past
this would require two nodes, one for properties and another (terminal or local) for the value. This resulted in two
graph redraws. Adding the value property to the existing node and not using the terminal or local will result in one
less graph redraw, which may or may not be important for your application.
On the other hand, because they can update a subset of the data, property nodes do not implement the same
shortcuts that the locals and terminals do. When updated with the same value over and over, a local and terminal
will not redraw the control, but the value property will. Additionally, for controls that are updated very quickly i.e.
more than 50 times a second, terminals and locals have the option to amortize the redisplays and save CPU cycles
that would otherwise be spent redrawing things you wouldn't see anyway. There is the option to synchronize the
display with the diagram updates, and the value property is basically stuck using this synchronized version each
time. This is identical to how controls and indicators updated before LabVIEW 5, and it is still how the displays
are done on single threaded systems such as any Macintosh with OS 9.x or previous.
To see this, drop a for loop, wire i to an indicator and have the loop execute 1,000,000 times. Initially, update the
indicator with the terminal. Run the program and it will take a fraction of a second. The indicator will display 0, a
few numbers in between, then 999,999. Move the terminal out of the loop and update with a local. You will see
the same. Now popup on the indicator and choose synchronous display -- it is in the Advanced option in LabVIEW 6.x and 7.x. Now you will probably need to abort the VI because it will
take several minutes to run because it is drawing every single number to the screen making a nice blur of digits for
you to look at. Now, delete the local and use a property node instead. Regardless of the setting of the synchronous
display, you will see the display is showing each and every one of the updates.
The fact that the value can be set from subVIs is a great feature, but it will make your diagrams more difficult to
debug if you make a mistake. When a string or the indicator has the wrong value being displayed, you need to
find the code that did the update. If only using the terminal, there is only one place the indicator is updated, and
you can work backwards from the terminal. If using locals, then you have a list of places to work backwards from.
If you are passing the control reference to the indicator to some number of subVIs, then you can have many
potential "updaters", including dynamic ones. So, while this is a nice feature for modularizing code and separating
it from the display, be careful or it will have debugging expenses that you may not want.
The following link details LabVIEW performance and memory management. It includes descriptions of tools for
profiling your VIs to see changes in memory and running time
文章评论(0条评论)
登录后参与讨论