LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using global variables between LabVIEW built applications

Hi,
 
Firstly, Im sort of an idiot with this stuff, so please excuse my ignorance!!  I am trying to develop a bunch of applications that communicate with a central VI through 2 global variables.  Think of it as if I am transmitting messages back and forth, and one of those variables is for communication from any application to the central VI and the other variable is for communication the other way.  As for the applications, any one of them (or multiples of them) can be open at any given time.  So the end user has the ability to open one or two or more "panels" and they all work at the same time.
 
Anyway, my problem lies in the use of the global variables.  This whole system works great when I am using it in the labview development environment, but when I try to build applications out of my vi's, I have problems  Its like each application has its own instance of the set of global variables, rathar than sharing them like they did in the Labview environment.  So what this means is that only one application will work at a time, and when I try to use a second one at the same time, it wont "connect" to the globals.
 
I have also tried implementing Network-published shared variables, which I think is the wrong way to go simply because of timing issues, and besides, I don't need to publish these things on our network.
 
So is there any way that I can easily share data between built applications?
 
Thanks!!!
0 Kudos
Message 1 of 2
(2,659 Views)

The best way of communicating between two different applications is using TCP, which is essentially what the shared variable does. I would say that they are still your best bet, since they should act basically the same as globals, so that you don't change your code. Since I don't have any experience with them, I can't comment on what you said about their speed.

If you want, you can also use VI server (example). Note that you will need to set a different VI server port for each of the applications which will need to publish. If you only have a single application that publishes, you shouldn't have a problem, although I'm not sure how this will work if you have multiple instances of the same executable. You might need to create a server application just for this, but that's essentially what the shared variables are, so there's no point in reinventing the wheel.

Another option is direct TCP or UDP communication (example), but I don't think this is relevant in your case.


___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,625 Views)