LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

local variables vs property knots->value

What is the advantage of local variables versus property knots (value)?
They tell in the manual, that for every local variable there is always a copy made of the original
input/indicator. If i use the property knots (value) no copy is made.
So what is the use of local variables?
Which methods exits else to avoid too long wires?
 
Sneff
 
 
0 Kudos
Message 1 of 7
(3,083 Views)


Sneff wrote:
...
Which methods exits else to avoid too long wires?
...
Hi Sneff,
"to long wires" doesn´t exists. To use wires is better then everything else! A good solution to have a clearly arranged block diagram is to use a state machine architecture.
Mike


Message Edited by MikeS81 on 05-06-2008 01:43 PM
0 Kudos
Message 2 of 7
(3,082 Views)
As Mike already told you, you should try to avoid variables (both locals and globals) just as usage of property nodes value. There are several reasons for this:
- Bad diagram design with variables
- Trying to work around a bad architecture by using variables instead of switching to a fitting one
- race conditions (insecure datamanagement)
- performanceissues

Besides that, using variables vs propety nodes (value) are the following:
- property nodes are always executed in the UI thread => slow
- variables as well as the property node copy the data of the control\indicator in case of reading => exposed, well, predestinated for race conditions

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 3 of 7
(3,076 Views)

Thank you,

 

but what do you mean with state machine architecture and race conditions?

 

Greetz

 

Sneff

 

0 Kudos
Message 4 of 7
(3,063 Views)
http://en.wikipedia.org/wiki/Race_condition

http://en.wikipedia.org/wiki/State_machine

If you want to know how a state machine in LabVIEW looks like, you should either try the example finder or the "design patterns" in the template browser (File->New).


hope this helps,
Norbert

EDIT: Updated links for "link-behaviour"


Message Edited by Norbert B on 05-06-2008 07:29 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 7
(3,054 Views)
study here and here
0 Kudos
Message 6 of 7
(3,050 Views)

Yeah, thank you that helped.

I try to code my VI like a state machine.

This fits perfectly to the rest of my concept.

 

Greetz

Sneff

0 Kudos
Message 7 of 7
(3,025 Views)