LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT target IP setting

Okay very good.

What i would recommend then is to use the DNS name on your local network (assuming you have a DNS server locally, which you should if you have DHCP), or assign it a static IP while you are building and testing. Now, is this a LabVIEW app you're running on the PC to communicate with the remote target or are you going to be communicating remotely with MAX?
0 Kudos
Message 11 of 16
(2,037 Views)
I use 'hostname.vi' (search for host example).  In many cases you can address the connection this way.  I also extract the IP address from the host name using the attached .vi
0 Kudos
Message 12 of 16
(2,035 Views)
That's fine for a system that employs DNS, but assuming the customer is living in the 18th century and is using sundials to resolve names to IPs, the VI you provided won't work. You will need to use something like find all targets or ping controllers.vi in order to make this work. And they say UDP doesn't have it's benefits....
0 Kudos
Message 13 of 16
(2,029 Views)

Hi Jordan

The problem is that I don't know where I could find DNS name. I tried to use DNS IP address, it does not work. The LabVIEW application I have consists of 2 parts. One is GUI part which run in a PC, another part runs in RT target. GUI part receives operator instruction, sends commands to RT and receives status/result continously from RT target. The communication between PC and RT target is through network shared variable. Are these network shared variables associated with RT target IP address?

Jason

0 Kudos
Message 14 of 16
(2,016 Views)
It seems that the new network shared variables communicate with what NI calls NI-PSP... what the underlying architecture of this protocol is, i have no idea, this is of course assuming you are using LV 8.5. Older versions communicate with TCP/IP. So yes, in that respect, it is tied to the IP address. I'm wondering why you aren't using a remote panel and publishing all of this using HTTP?
0 Kudos
Message 15 of 16
(2,009 Views)

Using the static IP address will fix the problem as many already suggested. However, of someone wants to use DHCP or even change static IP address, he also needs to change the IP address from the LabVIEW project as well. Using windows hosts file can solve the problem. The Hosts file is a common way to resolve a host name to an IP address through a locally stored text file that contains IP-address-to-host-name mappings. If you want to read more about hosts file, use the link http://technet.microsoft.com/en-us/library/bb727005.aspx

A hosts file looks the following

 hosts.png

 

I have added the last line as 192.168.0.4 cRIO-Name. I used “cRIO-Name” as DNS name instead of  IP address in the project(Actual IP Address 192.168.0.4). Everytime I need to change the IP addrss of my RT I also change the IP address in the hosts file. That way I don’t need to change the IP address in the project.   

 

 1.png

 

A very simple examle is given.

1.      Read all IP and MAC addresses

2.      Get the MAC address  of the RT you are intersted in

3.      Change the IP address

4.      Open the hosts file located at “C:\Windows\System32\drivers\etc”

5.      Read the file. Add or edit the IP address with DNS Name and close the file.

 

 project.png

 

 

 

block.png

 

 

0 Kudos
Message 16 of 16
(994 Views)