We are working on a project where there are multiple cRIOs with the same code that might be plugged into any given computer and stream data via network streams. So we are changing the hostname of the devices to be a unique name and I'm finding the IP address of each device by the hostname. Everything works with the method below but it takes about 15 seconds to query each IP address. Anyone know of a faster way to translate the hostname into an IP address?
Solved! Go to Solution.
Another way of going about this is using the command line (system exec) and pinging each device with the -4 flag to get its IP and a text replace to find the IP from the result.
Other option is to have each device publish or register itself into a network server. I have used SystemLink Cloud for this, where my systems will post a tag with their identification information and I will read it using the Skyline API in wither LabVIEW or LabVIEW NXG. I can also see the tag data in a SystemLink cloud Dashboard.
Finally, my recommendation is checking out SystemLink, which is dedicated to asset management. You can register all your cRIO devices to a SystemLink server and have all their information and performance handy. You can also use the tags I mentioned before (just pointing to the SystemLink server and not the SystemLink Cloud URL).
All the best,
Use the built in TCP functions. Very fast, pure G and cross platform.
Yes, that is pure DNS call and does not actually ping the address and wait for a response. So it does a bit less but does what is needed and thus is faster. I assume you detect if the instrument is actually at that address by either attempting to connect or by merely using the TCP Open command with the needed port.