LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable

Solved!
Go to solution

In a previous Discussion Post the user was refered to an example here:  https://decibel.ni.com/content/docs/DOC-21163

In the block diagram ( Main.vi) of the Project is an "icon" of the STOP button w a globe in it..I'm guessing thats a global variable.

Why is the developer using a global variable ??  Why not just a local?? What is the "variablelib.lvlib" that this stop button is contained in and why is it used??

Thanks..

0 Kudos
Message 1 of 6
(3,513 Views)

Hi Clint,

 

that's a shared variable.

 

Their advantage is: they allow access (read and write) over network connections (and they allow DATAFLOW due to their error IO).

 

In the referenced example you are able to stop the dialog from a different VI, executable or even a remote computer…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,503 Views)

Thanks..so how do I create that same type of llb for my project..I want the same idea.  I want to "STOP" two loops simutaneously if a condition is met.  Can I use the examples STOP button?? How do I copy it over from the example to my program and link it to the llb? 

0 Kudos
Message 3 of 6
(3,489 Views)
Solution
Accepted by Clint1000

Hi Clint,

 

you should use a "usual" global variable when you have two loops within one VI/program. No need for shared variables then.

 

To answer your question:

You create shared variables within your project. Just right-click your project tree and select New->…

Use the correct LabVIEW terms: shared variables are maintained in lvlib files. These are different things than LLBs!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,483 Views)

thanks for the quick response..

0 Kudos
Message 5 of 6
(3,478 Views)

Let's sort out the few main variations of variables.

 

Local variable - use in different locations in same VI.

Global variable - use in different locations in different VI's on the same PC

Shared variables (networked) - use in different locations in different VI's on different PC's

0 Kudos
Message 6 of 6
(3,462 Views)