LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

assigning labels to terminals of functions in block diagram

Hi, I was wondering if there was a way to assign terminals of names to connect them to each other, rather than wires.  That way there can be a "wireless" connetion between different elements.  You can do this in various circuit simulation programs, just wondering if this was possible in LabVIEW?  Thanks for the help.

0 Kudos
Message 1 of 5
(2,369 Views)

Yes, it's called Local Variables, and no, you shouldn't use them to make your diagram look better.  Showing the wired connection has a very good purpose.  There's lots of threads in these forums about coding styles, I'm a better programmer for reading through them, recommend them to anyone.


--Using LV8.2, 8.6, 2009, 2012--
Message 2 of 5
(2,367 Views)

@taper wrote:

There's lots of threads in these forums about coding styles...



Like this one (specific to local variables): http://forums.ni.com/t5/BreakPoint/Why-some-people-say-Local-Variables-are-bad/td-p/711239

0 Kudos
Message 3 of 5
(2,364 Views)

Ok thanks.  I was interested in doing it to clean up my program a little bit.  I actually figured it was equally as confusing to read code that has wires going every which way.  Now that I know it is the standard around here, I will stay away.  Thanks.

0 Kudos
Message 4 of 5
(2,358 Views)

@baseball07 wrote:

Ok thanks.  I was interested in doing it to clean up my program a little bit.  I actually figured it was equally as confusing to read code that has wires going every which way.  Now that I know it is the standard around here, I will stay away.  Thanks.


Stay away from LabVIEW or local variables? Unfortunately there is no shortage of poorly written LabVIEW code (as well as most other programming languages) that is a pain to look at. However with good programming practices and good style LabVIEW code can be very clean and easy to read. If your diagram is a mess of wires that generally indicates a poor design or the wrong architecture for the problem.

 

Now if you are saying you will stay away from local variables that is a good idea. As mentioned, there are volumes written about why overusing local variables is a bad thing. One of the biggest reasons is that they introduce race conditions.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 5
(2,347 Views)