‎11-19-2011 07:36 PM
If I have numeric control where would be advantage to use its reference intead of local variable or property?
‎11-19-2011 07:40 PM
You don't just use a reference. You use a property node. It can either be implicitly connected to a control, or you explicitly call it by way of a reference wired to it.
Either way, local variables have better performance than value property nodes. But the advantage to property nodes is that you can programmatically determine which controls you want to reference. For example, you could have an array of references and programmatically loop through them to write values to each one.
‎11-19-2011 08:22 PM
@Vasilich2004 wrote:
If I have numeric control where would be advantage to use its reference intead of local variable or property?
This question is way too open ended. Use for what, exactly???
If you are talking about the value of the control:
Typically you would wire directly to the control to use the value in your code via the wire.
If you need to programmatically change its value (it is a "control", so this should be rare!), you would write to a local variable of the control.
If you need the value inside an indepedent code segment elsewhere, read from a local variable of the control (but be aware of possible race conditions).
If you want to do the same from within a subVI, you would need to wire a reference of the control to the subVI and use a value property node there. (you could also use a value property to read or write from within the same diagram, but a local variable is more efficient and elegant.
If you are talking about any other property, you would use a property node linked to the control. (local variables are useless except for the value!). If you want to modify a property frm within a subVI, you would again wire a reference to the subVI so you can access the properties using a property node wired to the reference.
‎11-20-2011 12:42 AM
Typically, I wire to local variables ...
‎11-20-2011 01:33 AM
‎11-20-2011 01:43 AM
Is this discussion related to your recent idea?
You really cannot efficiently get ideas across using cryptic one-line statements. Please write up a well formulated paragraph of exactly what you are trying to do, how you are doing it, and why you think your approach is better.
Include an example program!
Include some images!
Thanks!
‎11-20-2011 11:34 AM
not really.
at first, it is related normal language.
at second, it would be easy to use.
‎11-20-2011 11:40 AM
@Vasilich2004 wrote:
Typically, I wire to local variables ...
As opposed to what?
I put controls and indicators in one place in left side where I have initialization step. That give more chances to avoid mistakes during initialization.
If program rectange small I don't need to use right click on local variable to find control - I just look on left side.
‎11-20-2011 11:40 AM
@Vasilich2004 wrote:
not really.
This is not even a full sentence. What are you referring to?
Vasilich2004 wrote:at first, it is related normal language.
at second, it would be easy to use.
What is "it"? What is "normal"? What is "easy"? Why?
If you think you have a magnificient idea, you need to be able to communicate. As I said, show some examples!
‎11-20-2011 11:56 AM
A:Is this discussion related to your recent idea?
V:not really.
-----------
V: at first, it is related normal language.
at second, it would be easy to use
A:What is "it"? What is "normal"? What is "easy"? Why?
V: it is LabVIEW
normal language - Java, C++, C#
easy - because easy to use
why - because LabVIEW system would be simpler
-----------
A. If you think you have a magnificient idea, you need to be able to communicate. As I said, show some examples!
V. this is style which is not example of program.
That is not madnificient idea ... I would said it is very primitive idea.
I also can say that LabVIEW developers can communicate also.
I think I wrote really simple suggestions as I could. (English is not my native language )
If you have any doubt or misundestanding you can communicate write me e-mail I will try to explain better.