LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Multicast

The UDP Multicast support that comes with LabVIEW 7 has some disappointing limitations. As a listener, my application wants to join two multicast groups (say, 225.1.20.1 and 225.1.20.2) on a single UDP Port (say 49900). On the OPEN to the 2nd address group, the NI support in <<LabVIEW 7.0\vi.lib\Utility\tcp.llb\UDP Multicast Read-Only Open.vi>> will generate "Error 60: Possible reason(s): LabVIEW: The specified network address is currently in use."

The underlying reason for this is baffling. These are clearly separate network addresses, so the message is misleading. The port is the same, and this may be the "network address" currently in use. If so, it is a peculiar constraint.

On a single socket in a Unix/Linux environment, you can join multiple groups via setsockopt(IP_ADD_MEMBERSHIP). Most implementations limit on the number of groups that can be joined on one socket. (Used to be 20 for BSD derivatives). But a limit of 1?

So, here are the questions:
1) Is this a limitation of the Microsoft UDP/IP stack?
2) Has this constraint been removed in later versions (do I need an upgrade?)
3) Any suggestions on where to go from here?

Message Edited by Molly K on 02-22-2005 08:35 AM

0 Kudos
Message 1 of 4
(4,040 Views)
I have the same problem. This is really bad.
0 Kudos
Message 2 of 4
(3,961 Views)
I got an answer to this from someone at NI, but I can't find the eMail message. In short, you have to modify LabVIEW.ini in folder C:\Program Files\National Instruments\LabVIEW 7.0 (To do so, you need admin privileges under Win XP -- bummer, aye?)

Modify existing or add new key/value pair, as follows:

SocketSetReuseAddr=TRUE

I don't know what the limit is on the maximum number of concurrently opened addresses, but most TCP/UDP protocol stacks have a fixed limit. My application subscribed to 24 publications (unique multicast addresses) on a single UDP port, and it worked well (no drop-outs, lost messages, etc.)
Message 3 of 4
(3,950 Views)
If you want the UDP connection to have multiple listeners:

- Open the file: LabVIEW.ini (it is most likely located in C:\Program Files\National Instruments\LabVIEW 7.x, where "x" is the version number.)
- Add the line: SocketSetReuseAddr=TRUE
- Restart LabVIEW. The changes should take effect.

If you do not want to have multiple listeners, but want to be able to have multiple writers to the same port, this does not apply. You can open different local ports so as not to generate Error 60 and then write to the same remote port without causing an error.

If you are trying to communicate with multiple devices using the LabVIEW UDP VIs where each device has a unique IP addresses that are both listening on the same port in parallel, you can do the following:

This error occurs because you cannot open multiple connections on the same local port. However, the local port and the remote port do not need to be the same. The local port is determined by the "port" inputs of the UDP Open VIs. The remote port is determined by the "port" inputs of the UDP Write VIs. For each write, set the remote port to the one on which the corresponding device is listening.

I would also recommend that you look at the following link:
http://zone.ni.com/devzone/conceptd.nsf/webmain/BB41313D7AB28CBD86256802007B8DC5?opendocument

Nandini Subramaniam
Applications Engineer
National Instruments
Message 4 of 4
(3,941 Views)