Jump to content

Recommended Posts

Are all the applications using the messages LabVIEW applications? If so then I think the simplest and quickest way to implement this is to use networked shared variables. These allow you to use a publish-subscribe protocol. (You said you wanted to broadcast the message.)

If you just have one message you write periodically you could use just the TCP/IP primitive VIs in a loop to write the same message to each recipient. (Or you could use UDP to broadcast.)

There is also a Simple Messaging Reference Library (STM) available. Personally I think these can give you a good idea of how things should work, but I don't know why anyone would use them instead of shared variables (since these already do the work for you).

Link to comment

Hi All,

I want to develop a simple pc messenger application using TCP\IP protocol. I want to send a broadcast message to all the systems connected on LAN how can i do it and also how can i get all the IP address os all systems on LAN

TCP does not support broadcasting as it requires a connection for each communication link, however UDP does allow for broadcasting to all systems on the local subnet. Each system listening just needs to open a UDP port at a known port number, and then you can broadcast a message using UDP to that given port number. (Send the UDP message to 255.255.255.255 for broadcasting.) You can send out a Discover or Ping message so that each system listening responds to the sender with its name and IP address. This wil provide a list of available systems to the sender.

You can check out the Asynchronous Message Communication (AMC) reference library which handles most of what you are asking for. It includes a Ping function which will discover all of the systems on the network which have the AMC listener enabled. This allows you to get a list of devices on the network so that you can send directed messages to each.

Link to comment

TCP does not support broadcasting as it requires a connection for each communication link, however UDP does allow for broadcasting to all systems on the local subnet. Each system listening just needs to open a UDP port at a known port number, and then you can broadcast a message using UDP to that given port number. (Send the UDP message to 255.255.255.255 for broadcasting.) You can send out a Discover or Ping message so that each system listening responds to the sender with its name and IP address. This wil provide a list of available systems to the sender.

You can check out the Asynchronous Message Communication (AMC) reference library which handles most of what you are asking for. It includes a Ping function which will discover all of the systems on the network which have the AMC listener enabled. This allows you to get a list of devices on the network so that you can send directed messages to each.

If you use UDP and broadcasting you need to be aware that most switches will restrict UDP broadcasts to a single subnet. If you are in an environment where you may have multiple subnets the UDP broadcast scheme may not work in this environment. This has nothing to do with LabVIEW but rather how most networks and switches are configured.

Link to comment

I just downloaded it, tried it, and was going to suggest it! :thumbup1:

LabVOOP may be a bit much for someone new to LabVIEW though...

OFFTOP There is no much LVOOP, only a clever cluster, no more. So it's understandable by any.

TOTOP: So you may try to collect all connections into an array and send to all in a for-loop (if you use TCP) and send a broadcast to all if you use UDP (but without ack).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.