LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deploying Shared Variables on different host PC

Solved!
Go to solution

So I have a PC on the production line running a LabVIEW .exe that runs a Vision Builder AI file in the background. I am using shared variables to communicate between the two software. I use my development PC to build the LabVIEW .exe to which I run it on the deployment PC. The deployment PC has no network connection, it has no need to communicate with any other device as of right now but in the future it will be connected to the network. When I run the .exe and the variables are deployed, the variables are unable to communicate between the two software on the new host PC since I am unable to add the deployment PC to the .aliases file without a network connection. I have read numerous post about shared variables being deployed but have not yet found anything about being able to deploy to a PC with no network connection. What I have been doing as a temporary fix is after the variables are deployed, I open Distribution System Manager and link the variables with the vision builder variables on the new host PC. This gets somewhat tedious at times since I have around 30 variables and I have to do one at a time. I would like to be able to deploy them on the new host PC and have them connect without any issues. This way if the power goes off or I have to make some minor changes to the LabVIEW file I won't have to reconnect all the variables when they are redeployed. 

 

At this point I am thinking it is not possible without a network connection but I would be happy if someone told me I was wrong.

0 Kudos
Message 1 of 7
(3,086 Views)

Hi Clayton,

 

Is there no possibility of temporarily connecting the deployment pc on the network when you build the executable so that you can add the alias? Or could you maybe temporarily install and activate LabVIEW on the deployment computer to complete the build process with correct aliasing?

 

TyVo

0 Kudos
Message 2 of 7
(3,056 Views)

At this time, it is not possible to connect to the network on the deployment pc. I could install the full version and build it on the deployment PC but I was trying to stay away from that since there are multiple PCs the executable is being run on. This would mean installing the full version on each PC then building the exe on each separately. I make changes to the LabVIEW file when I run into some problems that I haven't encounter yet or something with the UI needs to be changed. I am trying to keep it simple and do all the changes on the development PC so all I would need to do is run the executable on the deployment pc. I realize once everything is hooked up to the network, things will be easier to deal with but I don't see that happening anytime soon. 

0 Kudos
Message 3 of 7
(3,049 Views)
Solution
Accepted by topic author edgemfg

Can you leverage the Open Variable Connection VI in your LabVIEW executable? You can define a constant variable refnum of the type ni.var.psp://<machine_name_or_IP_address>/<library>/<variable>. I'm not sure what order things happen in your current set up but if the variables are already established and hosted on the local machine, your LabVIEW executable should be able to connect this way.

Message 4 of 7
(3,039 Views)

I have not used this method before so I want to make sure I would be doing this right. Originally, when I build the executable on the development pc, the variables will keep the localhost name of the pc I built them on. So when I deploy the variables to the deployment pc, the variables will search for the path of my development pc to which they can't find since the pc is not hooked up to the network. Then I go into NI DSM to changed that path of the variables to the new localhost. If I am understanding this method correctly the steps I would have to take would be:

 

1. Make sure the variables library are already on the deployment pc by deploying them through the executable once and changing their directories like I do already.

2. Add this method to the set up defining the variable refnum to match the variables on the deployment pc like you said so that the Open Variable Connection VI will be able to connect to the variables.

3. Make sure to disable the deploying of variables through the executable so that they won't overwrite what I changed. 

 

Would this be the right way of doing it? 

0 Kudos
Message 5 of 7
(3,036 Views)

That sounds correct. Post an update whether it works or not. We might be able to troubleshoot further if we find any issues with this process.

0 Kudos
Message 6 of 7
(3,031 Views)

After talking about this I realized I could just disable deploy variables in the build after the variables are already deployed on the pc. That way the variables have the correct path and I won't have to change them every time I start the executable. Such an easy solution, I feel stupid not thinking about it before hand. Your method worked as well when I tried it with a couple of the variables. I will stick with what I did since it would be easier to just disable the deploying of variables rather than adding the Open Connection Variable VI for each variable. 

 

Thanks for the help TyVo!!!

Message 7 of 7
(3,025 Views)