取消
显示结果 
搜索替代 
您的意思是: 

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 wonderful
Thx,
Samer,
0 项奖励
1 条消息(共 2 条)
2,676 次查看

Hi Samer,

I wrote the Action Engine Nugget to illustrate a safe and effective way of sharing data between multiple thread.

Re: your Q

Both gloabl variables and reference>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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 项奖励
2 条消息(共 2 条)
2,670 次查看