global variable and reference

This is a discussion on global variable and reference within the labview forums in Programming Languages category; Hi, Could you tell me the difference between the "global variable" and "reference" ? If i create a control in a VI and i need to use its value in a subVI should i use a reference or a global variable ?In the other hand, if i create control in a subVI and i need to use its value in a VI should i use a reference or a global variable ?If you could explain me by a VI that would be wonderfulThx,...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-09-2008, 12:10 PM
samerham1
Guest
 
Default global variable and reference

Hi, Could you tell me the difference between the "global variable" and "reference" ? If i create a control in a VI and i need to use its value in a subVI should i use a reference or a global variable ?In the other hand, if i create control in a subVI and i need to use its value in a VI should i use a reference or a global variable ?If you could explain me by a VI that would be wonderfulThx,
Reply With Quote
  #2  
Old 07-09-2008, 12:40 PM
Ben
Guest
 
Default Re: global variable and reference

Hi Samer,
I wrote&nbsp;the <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=240328&amp;view =by_date_ascending&amp;page=1" target="_blank">Action Engine&nbsp;Nugget </a>to illustrate a safe and effective way of sharing data between multiple thread.
Re: your Q
Both gloabl variables and reference&gt;Value are subject to potential race conditions.
Globals require all of their instances be updated anytime one is updated. So they dont' scale well either.
References force a thread switch to the UI thread (single thread so this is a bottle neck)
So PLEASE take a look at that Nugget.
Thank you,
Ben
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.