LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ports of UDP connections

When I communicate with a device, using LabView (5.1) UDP VIs, and the device is specified to use a certain port number, must I have another local port number for my PC/LabView or can the same port number be used for both communication ends? I.e must the port number for the UDP Open.vi be different from the port number for UDP Write.vi?
0 Kudos
Message 1 of 3
(2,862 Views)
When you open a port with UDP Open on your computer, you're reserving that port locally on your computer. Subsequently, when you call UDP Write, you are specifying the port on the remote device to which you want to send data (your computer doesn't care what port that is).

Conversely, if your device is sending data to your computer, your device has a port open through which to send data. The data is delivered to a particular port on your computer (that port does not have to be the same port from which it was sent).

So to answer your question, no, you do not have to open the same port number on your computer. However, if your device wishes to send data to a port number on your computer, and that port number also happens to match the port number in use on the
device, then yes, the port numbers will match...but that's only because your device required them to.
Message 2 of 3
(2,862 Views)
Thanks for the help!
0 Kudos
Message 3 of 3
(2,862 Views)