07-20-2020 02:40 PM
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.
07-20-2020 03:27 PM
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?
07-20-2020 03:30 PM
Another reason your global variable are not working is because of race conditions.
07-20-2020 03:44 PM
@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.
07-20-2020 04:00 PM
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.
07-20-2020 07:02 PM
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.
07-21-2020 06:37 AM
@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?
07-21-2020 07:22 AM
@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.