LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receiving UDP packets from multiple IPs

Solved!
Go to solution

Hello. 

I need to listen a specific port, but two different devices transmit to this port at the same time. Two network cards are used to listen.

I want to specify from what IP I want to listen at specific time.

Here is flow:

1. Open UDP socket for port 30004 on IP 198.150.60.1 

2. Read data

3. Close socket

 

Do steps 1-3 but using IP 198.150.60.2

 

My issue now is, when I try to input net address to UDP open it gives error 54. But it works perfect if I just open UDP for the port without IP address. 

Help for UDP open explains that net port input is used to specify specific network you wan tot listen. Am I missing something?

 

Thank you 

0 Kudos
Message 1 of 3
(4,647 Views)
Solution
Accepted by topic author Rus_K

I resolved this issue. 

I was using IP address of the sender. You have to use IP address of the local network card. 

0 Kudos
Message 2 of 3
(4,641 Views)

The UDP Read function returns the IP address where the message originated.  UDP Open IP address is to specify which network card on the local machine you want to use for listening or broadcasting. 

aputman
0 Kudos
Message 3 of 3
(4,618 Views)