LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binding to network published shared variable

In LV8, I have a network published shared variable in one application.  I reference this variable in another application by binding to it in the shared variable properties.  I've changed the machine reference to "localhost" like in the example.  It all works fine on my machine in development and exe.   (I'm running xp.)  However, when I install these applications on a different windows 2000 machine, the exe versions are still trying to reference the variables on the orginal machine.  The win2k machine doesn't show up on the variable list either.
 
In my builder, I have selected the variable engine, and I did run the installer.
 
Any ideas?
 
Thanks.
0 Kudos
Message 1 of 11
(4,777 Views)
Are the shared variables you are using going to be used across a network or just on one machine?  It sounds like you have defined the connections to be network shared and if they are just going to be used as global variables then you can just bind them to a project shared.  To do this when you are binding the control/indicator to the variable select Project Items instead of Network Items.  Once you have done this try to deploy you application.  Have you tried something similar?

Hope this helps!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 11
(4,761 Views)
The shared variable is on one machine, not network, however, they are two different applications and two different projects running simultaneously.  One application changes quite a bit, and the other doesn't.  That is why they are separated.
 
Is there a way to specify sharing variables between applications without making them "networked"?
0 Kudos
Message 3 of 11
(4,758 Views)
One suggestion might be to combine them into one project, since they are linked by a single shared variable.  If you have created the variable in the project (by right-clicking on My Computer in the project and selecting New >> Variable).  If it is going to be only one computer accessing the variable you can always configure it to be single process instead of network published (found under the Variable Type).  Once you have this done in your applications you can select to bind to the project variable instead of a network variable.

Hope this helps!
Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 4 of 11
(4,754 Views)

I tried that.  It only works if you set the variables to "network-published"  I then get the same behavior as before since it pulls in the variable manager again.

 

Any other thoughts?

0 Kudos
Message 5 of 11
(4,750 Views)

Some more information for you:

It appears that the exe's on the other machine are referencing the shared variables on my development machine.  Here's what I have:  one project, with network shared variables.  In this project, I have two vi's one server, one client.  They both reference the shared variables.  I build two exe's - one for the server, one for the client.  When I run in development mode on my dev. machine, you can see the variables auto-deploy.  I then copy the exe's to the non-dev. machine and run them.  It appears to work, however, when I shut down the shared variable service, the connection is not made.  When I start the shared variable service again, it works fine again.

What I really want to know is, how do I get the shared variables to exist on the non-development machine and get them to deploy without installing the development system?  There must be a way!

Thanks.

0 Kudos
Message 6 of 11
(4,745 Views)

Even more info:

The exe files only reference the development machine if I delete the "aliases" files.  Otherwise, it seems to not connect to any kind of data.

0 Kudos
Message 7 of 11
(4,742 Views)
I found this information in the LabVIEW help file which is talking about the exact same issue we are having. 

"If you plan to distribute a stand-alone application that uses shared variables, do not include the .lvlib file in an LLB or in the executable. Use the Source Files Settings page of the Application Properties dialog box to change the Destination of the .lvlib file to a destination outside the executable or LLB. You can deploy the shared variables in two ways:

  • Write the application so that it programmatically deploys shared variables at start time. Call the Deploy Library Method in the top-level VI of the application. In the Library Path input of the method, use the relative path to the .lvlib file that contains the shared variable.
  • Manually deploy the shared variables to the computer or target Shared Variable Engine before running the built application."
It would seem that would be the way to do what you are trying to do.  I tried all sorts of other combinations previously and haven't gotten anything to work so far, but haven't tried that yet.  I will post if I have any additional pointers.

Andy F.

-----------------------------------------------------------------
National Instruments
0 Kudos
Message 8 of 11
(4,728 Views)
I just got back onto this.  Thanks for the info.
 
I like the idea of deploying on vi-startup.  I'm trying to do this.  However, when I try the deploy library method, it chokes because the application reference is 0 (coming out of the "App Refnum" control).  I also tried to open an activex link to the labview_application, but it is 0 also.  Any ideas?
0 Kudos
Message 9 of 11
(4,683 Views)
Have you tried keeping the shared variable you are using referenced to My Computer. Then when you installed the app to a different machine before you start running the application, open the alias file and replace the IP address assigned to My Computer to the IP address of the installed machine ?


0 Kudos
Message 10 of 11
(4,681 Views)