LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A really basic UDP sender

Hi,
I am trying to make a basic UDP sender. I want to send the average speed of a vehicle to another computer by UDP. I saw an example in Labview 7.1 database: UDP sender.vi.

What I need to know:

How do I find my local and remote port number?
Is the remote host address, the IP address?

Thanks a lot for your help,

Have a nice day,

Phil
0 Kudos
Message 1 of 4
(3,445 Views)
Hello Phil,

The port number is the UDP port with witch you want to comunicate - it must be the same in both server and client. Take care that some are reserved for some previledged users and services (mostly from 0 to 1023) (for instance port 23 is the telnet port, 80 is the http port, ...).
Choose a port bigger than 1024 and I guess you will not have problems, the only thing is that server and clients processes must be comunicating in the same port number.
The remote host address is indeed the Ip address, but you can also use the machine name if it can be resolved by the system.

Hope this helps,
Paulo
Message 2 of 4
(3,395 Views)
See my example in this recent thread.

The remote port number is determined by the listening port of the server. You need to find out. (Many port numbers are assigned by IANA to certain services. For example, if this is a syslog server, you would need to send to remote port 514/UDP.)
The remote host address is the IP address expressed as U32 number. USe String-to-IP to translate a hostname (e.g. ni.com) or dotted-decimal IP address (e.g. 192.168.100.100) to the correct format.

In many cases, the local port is irrelevant. Often it is easiest to simply wire a zero to it. In this case, the OS will automatically choose a free ephemeral port. (If you choose a specific local port, there is always a finite chance that this particular port is already in use, giving you an error.).
Message 3 of 4
(3,389 Views)
Hi,
thanks both for your help. It is now working fine.

Many thanks,

Have a nice day,

Phil
0 Kudos
Message 4 of 4
(3,371 Views)