From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT target IP setting

Hi,
 
I have a PXI RT target. I use MAX to set IP settings as "Obtain IP address from DHCP server" and give the target a name. Every time when PXI is restarted, its IP address changes dynamically. In my LabVIEW project, I need to change RT target address in the RT target property correspondingly. Is there anyway that I do not need to change it. It seems that I could input DNS name intead of RT target IP address. Where could I find DNS name? Thanks.
 
Jason
0 Kudos
Message 1 of 16
(5,950 Views)
<disclaimer: I haven't used PXI, but I do a lot of FieldPoint and DHCP>

The simplest fix would probably be to assign a static IP to the PXI chassis.
Make sure the IP you choose isn't in the range offered by your DHCP server,
and isn't used by another device on your network.  You will have to set IP and
netmask at a minimum, gateway if you want to talk outside of your network,
and DNS if you will need the chassis to lookup (resolve) hostnames.

The other option is to configure the DHCP server to always give the same
address to the PXI chassis.  You will need the MAC address of the chassis,
then use that to configure the DHCP server.  Exactly how to do this is
completely dependent on the type of DHCP server you are using, but most
of them will allow you to do this.

Hope that helps, let me know if it doesn't.

Matt
0 Kudos
Message 2 of 16
(5,945 Views)
The host name in Measurement and Automation Explorer, on the same page as the IP settings, is the DNS name that is requested. It usually that ends up being the DNS name but it is up to the server to actually assign the name so it could be something different or or have something appended to it.
 
-JRA
0 Kudos
Message 3 of 16
(5,937 Views)
Hi JR A.
 
I will try that. I am not familiar with network stuff. May I know if DNS name is changed by server or have something appended to it, where could I find the actual DNS name? Is there any function in LabVIEW development environment whith which I could find such information.
 
Jason
0 Kudos
Message 4 of 16
(5,920 Views)
I conveniently omitted that because I didn't know how to do it, but you made me curious. I had to do some googling to figure out how to do it. It turns out the Windows ping command has a "-a" option that will resolve the hostname. So if you open the command prompt and enter "ping -a XXX.XXX.XXX.XXX" (where the X's are the target IP address), it will return "Pinging hostname [XXX.XXX.XXX.XXX]...".
 
-JRA
 
0 Kudos
Message 5 of 16
(5,888 Views)

Hi Jason,

There is a slightly more complex way to do this using some of the RT replication toolkit available by searching. As long as you know the name of the target, which becomes the DNS name, you can do this. It will be even easier if you only have one RT target (PXI in your case). You can use the Find All Targets.vi to return the information of all RT targets on the subnet. Set your timeout and let it run. You will receive back an array of clusters containing the information of the targets. Thus, if you know your PXI's "host name" you can just use the IP address the Find All Targets.vi returns. This VI uses a UDP broadcast so regardless of DHCP and DNS, it should work. Hope this helps.

 

Jordan O.

0 Kudos
Message 6 of 16
(5,658 Views)

Hi Jordan O.

Find All Target.vi seems doing the exact as in MAX. What I am thinking is that whether it is possible for LabVIEW project to detect the DHCP assigned RT target automatically. Further after I build the RT target code, could I use Find All Target.vi to get dynamically RT IP address and communicate the RT target with my PC.

Jason

0 Kudos
Message 7 of 16
(5,637 Views)
The find all targets vi is a way to detect and adapt your program to IP address changes programmatically. I guess in order to help you more with this, i'd have to know more about exactly what you're trying to do.

Jordan
0 Kudos
Message 8 of 16
(5,622 Views)
Hi,
What version of LabVIEW and the Real-Time module are you using?  You can use the RT Ping Controllers.VI to find all the devices on the local subnet. After you find this information you should be able to deploy applications programatically etc.  Like Jordan said it would be helpful to know exactly what you are trying to accomplish.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 9 of 16
(5,616 Views)

Hi Jordan and Eric

The LabVIEW version is 8.5 and Real-Time module is also the latest version that I am not sure what exactly it is.

Basically, after I use MAX to set "obtain IP address from DHCP server" for my RT target, every time when I open my LabVIEW project, I could not connect with RT target because RT target IP address is changed dynamically, so I need to use MAX to check the new RT target IP address and change it in the RT target property. Next day, I may need to change it again. I am just thinking whether I could use DNS name in the RT target property setting so that I do not need to change RT IP address everyday. But I could not find DNS name. Currently, I am using "Edit the IP address" which I am supposed that IP address is static for RT. Could it cause problem when I transfer the whole system to the customer's site because code in the RT target may already be built using the static IP address. What if the IP address is conflicted in the customer site. Correct me if I am wrong for the network stuff. What I want is that I built RT target code and set it as startup, bring it to customer site plug in the network cable, it should work and my LabVIEW GUI code in my PC is able to communicate with RT target without problem.

Jason

0 Kudos
Message 10 of 16
(5,601 Views)