LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Identify UDP Devices without Scanning All Possibilities

Hi,

 

I'm trying to find, then communicate with, a UDP 80x64 Infrared thermopile sensor. The sensor will always have the same IP as my local machine aside from the last three digits (ex: my computer is 111.222.333.444, sensor is 111.222.333.443). The only way I can seem to discover the camera is to perform a 'brute force' search on all local IP addresses (from ending in '000' to ending in '255'). My question here is: similar to "Find VISA Resources," is there a simple way to find the IP address of the camera without cycling through all 256 possibilities (see attached JPEG)? This would be similar to plugging in an Arduino and LabVIEW immediately seeing a new instrument on 'COM 12,' for example, without cycling through 'COM 1' through 'COM 99.'

 

This is mainly for any new camera that could be plugged into my computer, without knowing the exact IP Address beforehand. All I know before searching for the camera is that it will appear on Port '30444' has a Mask ID of '255.255.255.000', and will be the same as my local IP minus the last 3 digits. I've looked into 'UDP Multicast,' but can't seen to get that to work for this particular application.

 

Thanks for your help!

0 Kudos
Message 1 of 6
(1,327 Views)

Hi Trooper,

 


@trooper64 wrote:

The only way I can seem to discover the camera is to perform a 'brute force' search on all local IP addresses (from ending in '000' to ending in '255'). My question here is: similar to "Find VISA Resources," is there a simple way to find the IP address of the camera without cycling through all 256 possibilities (see attached JPEG)? This would be similar to plugging in an Arduino and LabVIEW immediately seeing a new instrument on 'COM 12,' for example, without cycling through 'COM 1' through 'COM 99.'


When you search for network devices by scanning their port 30444 then you need to cycle through all possible IP addresses. This is how every other port scanner works… (Ever heard of Shodan?)

Usually this is a one-time operation (at init stage of your program) and will not last very long! Set a small timeout, so the scan is finished within milliseconds…

 

Btw. you don't need to scan the IP address of your own computer, so technically you need to scan 255 addresses instead of 256… 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,283 Views)

You can try with an anycast datagram, i.e. sending to IP 255.255.255.255. If this works, beware that you may receive more than one answer if several sensors are on the LAN.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 3 of 6
(1,264 Views)

Ah ok gotcha, finding all LAN devices is ultimately what I'm trying to do; don't mind receiving multiple responses back.

 

So to send out a broadcast to all LAN devices, I can just write a UDP message to 255.255.255.255?

 

Edit: When sending on this address, I just get the response back from my local computer as opposed to the camera.

 

Thanks!

0 Kudos
Message 4 of 6
(1,239 Views)

@trooper64  ha scritto:

So to send out a broadcast to all LAN devices, I can just write a UDP message to 255.255.255.255?


I'm not sure it really works. Just suggested to try.

I did the same to find devices produced by my company a lo-o-ong ago. With Visual Basic 6 on Windows 98/NT. It worked for me.

Also, I received doubled response packet - from the same device - because I had two NIC in the computer.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(1,233 Views)

Ok got it. I'm surprised there isn't a VISA function for searching all LAN devices, seems like a useful tool to have (all I'm trying to find is the IP address of a device plugged into my ethernet port).

0 Kudos
Message 6 of 6
(1,228 Views)