LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variables

Hello Sir,

 

I was working on Global variables in the multiple VI's. When run the VI files then the Global variables will work fine.

 

But when I create a project for an executable file, If i execute that exe file then Global variables will not work. 

 

I want the global variables to work in executable file.

 

Please help me for this issue.

0 Kudos
Message 1 of 8
(2,134 Views)

Were the global VI's included in the executable?

 

I'd think they'd be included by default, but you might need to specifically include them under the build is some unusual circumstances.

 

When you say "will not work", what precisely do you mean?  Are you getting any error messages?

0 Kudos
Message 2 of 8
(2,110 Views)

Another reason your global variable are not working is because of race conditions.

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 8
(2,107 Views)

@Frozen wrote:

Another reason your global variable are not working is because of race conditions.


Without knowing what "will not work" means specifically or how your program is architected this was my thoughts too. If you could show us your code we might be able to help spot potential race conditions.

0 Kudos
Message 4 of 8
(2,096 Views)

Are you creating one executable for everything or one executable per VI? AFAIK you can't use global variables across multiple executables, but I've never tried. I think you'd need a Shared Variable for that.

0 Kudos
Message 5 of 8
(2,087 Views)

I'll throw out another possibility.  Maybe the desired values need to be set to default before building.  Better would be to set the values at startup from a configuration file.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 8
(2,050 Views)

@crossrulz wrote:

I'll throw out another possibility.  Maybe the desired values need to be set to default before building.  Better would be to set the values at startup from a configuration file.


Or a hybrid that would read the values into the global from a config file... or is that what you meant in the first place?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 8
(1,997 Views)

@billko wrote:

@crossrulz wrote:

I'll throw out another possibility.  Maybe the desired values need to be set to default before building.  Better would be to set the values at startup from a configuration file.


Or a hybrid that would read the values into the global from a config file... or is that what you meant in the first place?


Yes, that is exactly what I meant in the second half of my post.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 8
(1,990 Views)