LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global variables issue

Solved!
Go to solution

I have multiples subVI´s which send data to the main VI when are called using global variables. Then the main VI must send that data to another subVI´s called by another main VI to show it in its front panels. This works perfectly when all VI are executed in LabVIEW environment, however when it is doing by build aplication of main VI´s it is like global variables do not work since data are always zero... I can´t find the error cause, i checked build specifications and there is nothing about global variables, only the VI that contents them located in dependences of the project.

 

What could be the error???

0 Kudos
Message 1 of 8
(2,929 Views)
Global variables cannot be accessed from separate application instances. You dont say it explicitly but I guess you are trying to communicate between 2 exe's using globals. You can use shared variables but I strongly encourage you to explain more about your application as global/ shared variables may not be the best way to communicate data between your vi's.
Michael
0 Kudos
Message 2 of 8
(2,920 Views)

You are right, my idea is firstly trying to comunicate the aplications (.exe) using global variables to later  to comunicate through a network using shared variables to access acquired data from different PCs... I mean, a main PC acquire data using an aplication and those data can be accessed to monitor it. I want to this way because i am working in a single PC thus i want to test my program using global variables... Is possible share data between apps (.exe) using global or shared variables??

0 Kudos
Message 3 of 8
(2,910 Views)
Solution
Accepted by topic author andcp360

You can use shared variables, you cant use global variables. Shared variables can be local (to one PC) or networked.

Message 4 of 8
(2,906 Views)

Ok, i have two different projects... One contains the data acquisition main VI and its subVIs and the other contains the main monitor VI and its subVIs, is there no matter with shared variables in this case, i mean having different projects or must join all VIs into one?

0 Kudos
Message 5 of 8
(2,893 Views)
I think its easier if they are in one project. But you can use programmatic access from outside the project scope
0 Kudos
Message 6 of 8
(2,889 Views)

Ok i will take the simpler way... Finally, i guess that my test in a single PC i must use single process shared variable or can i use network-published shared variable???

0 Kudos
Message 7 of 8
(2,881 Views)
Networked will be fine.
0 Kudos
Message 8 of 8
(2,868 Views)