Receive UDP Message

A Receive UDP Message event trigger executes when a User Datagram Protocol (UDP) message is received.

Defining a Receive UDP Message event trigger

To define a Receive UDP Message event trigger, follow these steps:

  1. From the Workbench left pane, expand the node where you want to define the Receive UDP Message event trigger.
  2. Select the Project icon to display the Projects window, right-click a specific project tab to display its pop-up menu, and then select New.
    You also can select the New button at the bottom of the Projects window when a specific project tab has already been selected.
  3. The new Trigger window appears.
    Name the trigger. The trigger name can be up to 64 characters and include letters, numbers, and the underscore character. Spaces are allowed.
  4. From the Event tab, select the Trigger Event Type down-arrow, expand the Networking category, and then select Receive UDP Message.
     
    The Event tab becomes active with parameters that accommodate the Receive UDP Message event.
Parameter Description
Port The UDP port to receive messages from. The default UDP port is 5000. The valid values are 1 - 65545. A port value of 0 is not valid.
Maximum Packet Length The maximum size of the message to receive. Any data in the datagram beyond this size is discarded.
Output Type The data type  to convert the received message to. The options are Binary or String.

Receive UDP Message event type trigger event variables

The input event variables available to a Receive UDP Message event trigger are:

Event variable Data type Description
Data Based on the option selected for the Output Type parameter The data received from the specified UDP port.
Source Address STRING The IP address and port of the sending application, in the format ip:port.

Receive UDP Message event trigger considerations

  • If the UDP datagram received is larger than the Maximum Packet Length parameter, the extra data has been received and discarded, so it is not available for a future Receive UDP Message event. The exception to this behavior is for the Enterprise Gateway for Siemens ERPC product, which will keep the data beyond this size and make it available for another instance of the trigger execution.
  • If two or more Receive UDP Message triggers are defined and started with the same Port, then one or more trigger(s) will be Disabled. Meaning only one trigger can be started for the UDP port.
  • If multiple sending applications are sending UDP datagrams to the same IP address and port, then each sent UDP message will be received as a separate and distinct Receive UDP Message event trigger execution. The trigger execution behavior is based on the trigger settings for Max in Progress and Queue Size.
  • A Port value of 0 is not in the valid port range.
Related topics

Send UDP Message