LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Automaticall choose between two UDP ports?

New firmware has changed the active UDP port to where information is recieved. I am looking for a way to poll one of the ports (lets say 824) and see if it is active. If it is i want to use this port, If it is not i want to use a different one. I am new to labview and confused on how to approach this. I am using Labview2011.

Thanks,

Rob

0 Kudos
Message 1 of 2
(1,956 Views)

@Rlf5104 wrote:

New firmware has changed the active UDP port to where information is recieved. I am looking for a way to poll one of the ports (lets say 824) and see if it is active. If it is i want to use this port, If it is not i want to use a different one. I am new to labview and confused on how to approach this. I am using Labview2011.


Your description is quite unclear.

 

If you are trying to connect to an IP/port elsewhere? Simply try both and see which one succeeds.

Alternatively:

Is your LabVIEW program trying to listen on one or the other port for incoming packets or something else?

 

UDP is connectionless so there is no way to tell "activity" unless a packet of the right format actually arrives. If both server ports on the local computer are unused, I would just listen on both in parallel, then use the one that receives data. Note that due to random internet noise (especially if it is a well known port), random packets could arrive at either port, so you somehow need to check if the payload corresponds to the expected data format.

0 Kudos
Message 2 of 2
(1,950 Views)