LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control References

Hi everyone,

Could anyone tell me the differences between use control references instead variables(local/global) or property node valueand when use one or another ??.

 

Best regards!

 

0 Kudos
Message 1 of 6
(1,728 Views)

References are useful if you want to access control properties from within a subvi.

 

In LabVIEW, the wire is the variable and controls are for user interactions.

 

What problem are you trying to solve?

Message 2 of 6
(1,718 Views)

@GVELA94 wrote:

Hi everyone,

Could anyone tell me the differences between use control references instead variables(local/global) or property node valueand when use one or another ??.


Locals and a globals create copies of data.

 

A value property node doesn't, but it synchronizes it's updates with the screen's refresh rate.

 

References can be passed to subVIs, which allows functionality (reading\writing properties, incl. value) to be reused for different controls (by changing the input reference).

Message 3 of 6
(1,682 Views)

Sorry for the delayed response, I use the account just sometimes. I'm trying to figure out when use one an another because I use them simply for read/write function but I wanted a deeper response to really understand when is more appropriate each one.

0 Kudos
Message 4 of 6
(1,607 Views)

@GVELA94 wrote:

Hi everyone,

Could anyone tell me the differences between use control references instead variables(local/global) or property node valueand when use one or another ??.

 

Best regards!

 


A control reference is a reference to the front panel object, not the data itself.
A local/global is a copy of the data.
A property node is switching to the UI thread to read from the front panel object, thus very slow comparatively.

A wire is a reference to the data in memory, thus this is the fast and preferred way of working with data.
(It's a close enough description) 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 6
(1,586 Views)

@GVELA94 wrote:

I'm trying to figure out when use one an another because I use them simply for read/write function but I wanted a deeper response to really understand when is more appropriate each one.


As has been said, use neither! If you feel that you need to use controls/indicators for data storage or shuffle data around via value property nodes (there are many other property types!) or local variables, you might have misconceptions about dataflow and possibly seriously bad programming habits.

 

If you like, show us some of the code you are working on and we might be able to offer suggestion how to do things much more elegantly. A good way to store data across iterations is for example a shift register that allows easy read-modify-write operations. These are often fully in-place and don't involve any front panel objects with their associated data copies and transfer buffers.

 

Local variables and value properties have their use in rare scenarios. If you absolutely need one and have a choice, use locals over value properties because they have significantly less overhead.

Message 6 of 6
(1,561 Views)