09-16-2016 03:14 AM
Hii guys,
I have a communication H/W connected to my PC. Now I manually give the IP address to establish connection with this H/W.
Can I poll thr' labview and find automatically which IP address:Port is connected to my PC.
This comes handy in Test system as if there are 10 systems I dont have to maintain a INI file where I give the IP address and Port number, instead automatically determine the same.
I can do it for DAQ devices or Serial ports. How about TCP/IP.
regards,
Akshay
09-16-2016 03:16 AM
Also my Test system is on the Network. But I am of the opinion that windows differentiates between locally connected IP:port and N/W IPs
09-16-2016 03:26 AM
Hi Akshay,
you can send TCP/IP requests and check for an answer: when the correct answer is received you have found your hardware.
Or you can PING IP addresses and check the answer on those PINGs…
Generic answer: you need to scan your network for correctly configured devices!
09-16-2016 10:36 AM
hallo Gerd,
the Issue is there will be 10 test systems running. And the IP has to be found by the PC automatically.
I just want the my host pc to find the IP address of the slave and connect to it asap.
I as a INI file or text box Input am not in picture.
regards
Akshay
09-16-2016 10:42 AM
09-16-2016 12:42 PM
@aparab wrote:hallo Gerd,
the Issue is there will be 10 test systems running. And the IP has to be found by the PC automatically.
I just want the my host pc to find the IP address of the slave and connect to it asap.
I as a INI file or text box Input am not in picture.
regards
Akshay
How are the addresss on the test systems set? I am guessing DHCP?
How about reserving 10 IP addresses for your test systems that way you know where they are going to be?
09-20-2016 09:15 AM - edited 09-20-2016 09:23 AM
There is no generally designed method in the TCP/IP protocol itself that would allow for discovery of arbitrary network devices! In fact there are a myriad of device discovery protocols that all try to solve the problem of letting one find out about possible devices and their addresses on local subnets and even beyond. Many of them are proprietary and badly or not at all documented, like the one NI uses for discovery of their cRIO and other network devices. Most of them and some of the documented ones make use of UDP based broadcasts whith "magically" crafted message headers that a specific device recognizes and then sends a response with its current configuration to the originator of the discovery request.
There are also standards for device discovery such as LLDP (Link Layer Discovery Protocol) which are directly sitting on the IP level of the network protocol layer and therefore only can be implemented with raw sockets, not on top of UDP or TCP. That makes it impossible to create LabVIEW VIs using native LabVIEW network nodes to implement a VI library that would do LLDP. In addition on all modern OSes (Windows 7 and higher, Linux, MacOS X) raw socket access is a privileged feature that can only be done with special privilege escalation (run as administrator on Windows). To be able to run such a protocol from a normal user application level, one would need to install a specific kernel device driver, that handles the raw socket access in the kernel context.
As summary: No, there exists no common standard to do device discovery for an arbitrary network device. Depending on the device you have to use a specific method and often that method is proprietary and undocumented, and/or not possible to do with high level protocols sitting on top of UDP (or less likely TCP).