05-16-2013 11:11 PM
Hello,
I'm making a client-server application, run on 2 separate (non-real-time) PCs. So far, I've simply placed the client code and server code under different folders in the "My Computer" target, and created different build specifications for them. This does the trick pretty well.
However, I'm wondering if there's a way to add a second PC target (not a Real-Time Desktop)? There isn't an option for it under the "Add Targets and Devices" dialog. The closest I found was "Networked Computer/Device", but it looks like I can only build programs for NI hardware on that target, not desktop or server programs.
05-17-2013 01:53 AM
05-17-2013 06:15 PM
Hi JKSH,
It's actually not possible to add another PC as a target in your project. It sounds like a cool idea though, I'd recommend posting it to Idea Exchange: http://forums.ni.com/t5/ideas/v2/ideaexchangepage/blog-id/labviewideas
05-19-2013 06:47 AM
@GerdW wrote:
Hi JKSH,
why do you need to different "PCs" in your project? They are still the same "target" for your build specification...
Hi GerdW,
A "target" can also has an associated IP address.
Shared variables (SVs), which are hosted at a unique IP address, can be referenced via their host target's name:
(Image from http://www.ni.com/white-paper/4679/en)
Picture this scenario:
Currently, the client's indicators can't use Project Variables (i.e. reference-SVs-by-name), because LabVIEW can't treat PCs as different targets. As a result, I'd have to either:
However, with the Project Variable approach, to change the server IP, I just need to modify one line in the .aliases file that's attached to the client executable. (I've done this with CompactRIO targets) No hard-coding IP addresses, no extra code for dynamic binding.