Jump to content

Property node: Difference between revisions

From LabVIEW Wiki
Ederson (talk | contribs)
No edit summary
m Clarify performance considerations
Line 9: Line 9:
Clicking on the Property, you can choose what Property you want to '''Read/Write'''. You choose if the Property Node is '''Read''' or '''Write''' by right-clicking on the Property Node selecting '''Change to Read''' or '''Change to Write'''. By default, the Property Node is set to '''Read'''.
Clicking on the Property, you can choose what Property you want to '''Read/Write'''. You choose if the Property Node is '''Read''' or '''Write''' by right-clicking on the Property Node selecting '''Change to Read''' or '''Change to Write'''. By default, the Property Node is set to '''Read'''.


==Performance Issues==
==Performance considerations==
'''Property Nodes''' should be used carefully. That's because it is executed in the user-interface thread. Using '''Property Nodes''' indiscriminately in your code affects its performance because Block Diagram waits while properties execute in the user-interface. If your Property Node runs in a SubVIs, it makes the SubVI front panel to be loaded into memory. Try to limit the number of Property Nodes used in your application.
'''Property Nodes''' of user interface objects can have a significant performance impact. That's because their execution is serialized with other operations in the UI thread. Using '''Property Nodes''' indiscriminately therefore slows down execution because the Block Diagram waits while these properties execute in the UI thread. Many properties also force a VI's front panel to be loaded into memory. This increases overall load time and memory footprint.


One Property that you should avoid is the '''Value property'''. You should always use Controls/Indicator and its wires to Read/Write their values. If it is not possible to reach the terminal or wire in your code, use Queues, Notifiers, and even Local Variables to that, but '''never''' use '''Value property'''.
==Best practices==
Use local variables instead of the '''Value''' properties when accessing user interface objects in the same VI.


[[File:Captura de tela 2023-08-06 002028.png]]
[[File:Captura de tela 2023-08-06 002028.png]]

Revision as of 08:03, 6 August 2023

Object information
Owning palette(s) Application Control palette
Type Function
Requires Basic Development Environment
Icon

Property Nodes are nodes that you can use in your Block Diagram to GET or SET properties on a local or remote application, VIs, and objects. Property Nodes allow you to programmatically control the properties of a Front Panel object, for example: color, visibility, position, behavior, etc.

You can use Property Nodes in two ways: Explicit that you choose what the Control/Indicator it referees to, or Implicit that is the case when you use a Reference wired to the Property Node that indicates what is LabVIEW item you referee.

Clicking on the Property, you can choose what Property you want to Read/Write. You choose if the Property Node is Read or Write by right-clicking on the Property Node selecting Change to Read or Change to Write. By default, the Property Node is set to Read.

Performance considerations

Property Nodes of user interface objects can have a significant performance impact. That's because their execution is serialized with other operations in the UI thread. Using Property Nodes indiscriminately therefore slows down execution because the Block Diagram waits while these properties execute in the UI thread. Many properties also force a VI's front panel to be loaded into memory. This increases overall load time and memory footprint.

Best practices

Use local variables instead of the Value properties when accessing user interface objects in the same VI.