LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create global variables?

hi,
 
I have a question,
 
1. appreciate if someone can share with me how to create global variables and use it in while loop. why we need global variables? i have attached an example that i am studying.
 
thanks in advance.
 
 
 
0 Kudos
Message 1 of 5
(2,681 Views)
Hi Deylan,

you find globals in the structures palette. After putting this on your vi diagram you open the global and create controls/indicators as usual.

In your example you 'need' the global, because in a different vi this global is set by checking some conditions (user break, communication error, timeout, whatever). For this use it's very easy/convenient to use a global. Be careful (the same applies to local variables) to avoid race conditions.

Btw.: It's better to attach pictures (much better: vis) instead of proprietary file formats like Powerpoint...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(2,675 Views)
    Hi,

You simply go to in Structures Functions and take Glob you will get on your diagram icon with ?, double click on it it will open the window of global variables where you will put buttons or other command and indicators, save this file. return under your VI right click on Glob and select the good element. It is all.

http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/creating_global_variables/

Hope can help you

Greg
Greg S.
CNRS
LV 7.1 8.2 8.6 2009 2011 2012 2013 2014
LPMC - CNRS
N'oubliez pas de complimenter cela fait toujours plaisir.
Message 3 of 5
(2,671 Views)
hi GerdW,
 
thanks for replying.
 
 

 
Message 4 of 5
(2,628 Views)

hi Greg,

 

thanks.

0 Kudos
Message 5 of 5
(2,627 Views)