From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

JDP Science Tools

cancel
Showing results for 
Search instead for 
Did you mean: 

UDP Messengers?

At the GLA conference, someone brought up the possibility of UDP as an alternative to TCP Messengers.  UDP is not the same as TCP, and is not a drop in substitute, but it may have uses.  So I wanted to ask what use cases of UDP people have found.  Some possibilities:

  • Service discovery so one doesn't need to configure it addresses
  • SYSLOG message send or receive (or similar logging)

Crossposted on LAVA

Message 1 of 5
(2,566 Views)

For distributed systems all on the same subnet, I'm using UDP to share latest tag values between systems.

Additionally, I'm using UDP multicast to broadcast status so anyone on the same subnet can selectively choose which system status they care about without having to direct those messages to anyone specific.

0 Kudos
Message 2 of 5
(2,512 Views)

I use it to send non-critical telemetry from one system to one or more subscribers.

0 Kudos
Message 3 of 5
(2,504 Views)

What do you guys set "max size" to in the UDP Read?   It's default is 548, but I can't see any reason I wouldn't set it to the maximum UDP datagram size of 60k+.  What disadvantage is there to a large size?

0 Kudos
Message 4 of 5
(2,469 Views)

Here is a Beta Version to try (not for production code).

See the Example VIs in <LabVIEW>\examples\JDP Science\Messenger Library\UDP Example

 

Example Sender is an UDP Address type:

2020-11-20 08_20_12-Window.png

 

Note that this new address type can be used anywhere an address can (example: Register it to a Notification).   BUT, there is no Reply/Registration support, as there is no mechanism to route replies or notification back (as of yet, at least).

 

The receiving of UDP is handled by new "Forwarders", async processes that forward any UDP messages to a standard address, allowing UDP messages to be handled by loops using Queue, Event or Notifier Messengers:

2020-11-20 08_20_41-Window.png

You can have any number of Forwarders.  As is standard in Messenger Library, the Forwarders will automatically shutdown when their caller does, so there is no need for shutdown code.

0 Kudos
Message 5 of 5
(2,459 Views)