I have 4 CRIO devices and 2 PXI chassis that have a mix of static and dynamic addressing. I use the find system.vi to find the systems and return the IP address to open a connection to them. However when the dynamic address is changed the find system.vi can not find the system. the NI Network Browser can find all the systems. If I go into Max and setup the addresses for each system then the find system.vi will work until the addresses changes again. Question is, how can I find the ip address of the controllers independent of what is set in MAX like the NI Network Browser does? Eventually I will build the labview program running on the PC into an executable that will be run on other PCs that do not have MAX installed.
MAX is essentially a front panel for the System Configuration API. Most things that you can do in MAX can be accomplished programmatically using this API. When you say "if I go into MAX and setup the addresses for each system" do you mean that you are configuring a static IP address for the DHCP devices?
If you can see the systems by refreshing MAX you should be able to see them programmatically in LabVIEW. You can always include the System Configuration API as part of an installer for the PCs that will be running this executable without LabVIEW installed. They will require the LabVIEW Run-Time Engine as well.
The following links may be useful to reference:
Clarification on what you change in MAX that allows the systems to be found by the "Find System.VI" will be useful in continuing to try to solve this issue.
It is not consistant but to find it in MAX, I have to right click on remote system and select change IP and manually enter the new IP address. This may or may not work and sometimes I have to delete the system then create a new system using the IP address.
However, MAX aside. The main issue is why will NI Network Browser find all the remote systems with correct IP addresses and the Find System.vi will not show the system with the changed IP address or will show it with the old IP address.
See List Controllers.png
The NI Network Browser is using the System Configuration API under the hood. That's interesting that you are seeing different performance between it and MAX. Do you have to refresh the NI Network Browser to see the devices with the updated IP addresses change? Have you tried restarting MAX to see if the same results occur? Are these new IP addresses still on the same subnet as the host computer? The goal here is to isolate the different use of the sysconfig API between the two so that you can replicate that programmatically.
IP information currently:
System is at xx.yy.50.8 with subnet mask 255.255.0.0
network browser shows it at xx.yy.50.8
On my coomputer using above program shows xx.yy.50.8
My computer is at xx.yy.50.80 with subnet mask 255.255.0.0
The lab computer was connected to the system until this morning when I reset the system
Now the lab computer running the same program shows 169.254.220.123 (I believe this is a default prior to DHCP giving it an address).
The lab computer is at xx.yy.150.116 with subnet mask 255.255.0.0
The lab computer has a runtime license installed so MAX is not installed on this machine.
Running network browser on the lab computer shows the system as xx.yy.50.8
So what do I need to change in the program to get the correct address? Is there a command to forget and search again?
The find hardware only shows the devices on the pc not the systems on the network.
I downloaded and ran the program and after some investigation found that the first element shown is the Dell laptop and the other elements showed up as blanks for product names.
I am using Labview 14 service pack 1
Can you try wiring a False constant into the Find Systems.vi node, rather than a True? When I run the attached code, the first list displays my devices, whether or not they are listed in MAX, while the find systems with a True constant wired in displays only devices listed in MAX. You will still need to do the check you have in your code to determine if the devices are infact connected.
The code you provided is in a newer format and therefore I can not load it. However, I did wire a false into the find system and it still returned the incorrect IP address.. If the NI Network Browser is using the same routines, then there is some trick to forcing the system to search for new systems and not the stored local ones.