LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Port and addresses

I am a Baylor Grad Student and  am writing a vi to communicate a simple message, just a double precision number, in a timed loop. I have a UDP open and write with the address wired to each one with a string to IP vi. I am also using an executable program to listen for my message on a nearby computer. It provides the port and IP address, however when I run the VI, I always get the error message that says 'the network address is currently in use'. I am not very knowledgeable about udp communications, so can anybody enlighten me as to whay might be the problem and a possible solution?
Thanks,
tcemo
0 Kudos
Message 1 of 4
(4,935 Views)
UDP is stateless. You would first use UDP open (no need to wire host and port here) to create a connction ID, but then use "UDP write" with the target IP and port wired to it to write to the remote machine.
 
If you get stuck, please attach your code. Have you looked at the shipping examples?


Message Edited by altenbach on 04-29-2008 02:04 PM
0 Kudos
Message 2 of 4
(4,924 Views)
Ok,
So I have attached my code, It doesn't sound like it is too complicated, but the VI keeps breaking.
Also, where are the shipping examples?
Thanks!
0 Kudos
Message 3 of 4
(4,898 Views)
You have wired the net address of the remote computer to the port input of "open UDP"! Remove that!
 
You should wire a zero (U16) to the port input. This is for the local return port and it will choose an unused ephemeral port if zero. If you wire an actual port, you need to make sure it is not in use by another application. (check the online help for TCP open. UDP open acts the same but this fact has been omitted from the onlien help of UDP open).
 
Open UDP does not need a net address unless you have multiple adapters.
 
To find the shipping examples, open the example finder (help...find examples)  and seach for UDP. There is a nice selection, but start with e.g. "UDP sender".
Message 4 of 4
(4,895 Views)