LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a second PC target in an .lvproj?

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.

Certified LabVIEW Developer
0 Kudos
Message 1 of 4
(2,252 Views)

Hi JKSH,

 

why do you need to different "PCs" in your project? They are still the same "target" for your build specification...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,242 Views)

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

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 3 of 4
(2,209 Views)

@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:

  • The server PC hosts some network-published shared variables
  • The client PC's GUI has indicators that are bound to the server's shared variables

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:

  • Hard-code the server's IP address into the front panel (which would be bad if the server's IP address needs to change), or
  • Write extra code to read the server's IP address from a configuration file and perform the binding at run-time.

 

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.

Certified LabVIEW Developer
0 Kudos
Message 4 of 4
(2,177 Views)