# UDP driver message delimiter pattern match

**URL:** <https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200>\
**Category:** Ignition\
**Created:** [June 25, 2021, 9:35am UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200 "2021-06-25T09:35:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gino.miucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gino.miucci/32/19542_2.png) [@gino.miucci](https://forum.inductiveautomation.com/u/gino.miucci)\
**Post date:** [June 25, 2021, 9:35am UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/1 "2021-06-25T09:35:51Z")

</div>

I’m getting a message from a UDP device that transmits a variable checksum at the end of its message:  
Checksum=ABCD  
where ABCD is a 4-byte hex checksum value.

I’ve set the UDP driver to Character Based message delimiter type and entered as the message delimiter:  
Checksum=ABCD\r

If I were to write it as a regex it would be:  
Checksum=[[:xdigit:]]{4}\r

Since there are carriage returns elsewhere in the message I need to match the specific sequence of characters for the end of message.

Does the UDP driver support variable message delimiters in any way or is there another way round the problem?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 25, 2021, 12:08pm UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/2 "2021-06-25T12:08:17Z")

</div>

Are you sure you need a delimiter at all? UDP messages are typically one and only one packet.

---

<div class="post-metadata">

**Author:** ![gino.miucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gino.miucci/32/19542_2.png) [@gino.miucci](https://forum.inductiveautomation.com/u/gino.miucci)\
**Post date:** [June 25, 2021, 1:19pm UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/3 "2021-06-25T13:19:39Z")

</div>

The device sends multiple UDP packets for each message. The message is basically a text report (like sent to a serial line printer), with carriage returns between each line. Each UDP packet is a line of text in the report, with the last UDP packet being the checksum line. Unfortunately the packets are sent too quickly for me to process each one before the UDP message is replaced by the next packet.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 25, 2021, 1:22pm UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/4 "2021-06-25T13:22:16Z")

</div>

You’ll probably need to acquire this data via scripting instead of the UDP driver.

---

<div class="post-metadata">

**Author:** ![gino.miucci](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gino.miucci/32/19542_2.png) [@gino.miucci](https://forum.inductiveautomation.com/u/gino.miucci)\
**Post date:** [June 25, 2021, 1:57pm UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/5 "2021-06-25T13:57:47Z")

</div>

Looks like time for me to read up on Python socket comms!

A shame since the built in UDP driver does 99% of what I was after and handles all the socket comms & provides its own set of data and diagnostics tags.

Maybe pattern/regex message delimiter as a future enhancement to the UDP driver…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 25, 2021, 2:21pm UTC](https://forum.inductiveautomation.com/t/udp-driver-message-delimiter-pattern-match/48200/6 "2021-06-25T14:21:37Z")

</div>

> [@gino.miucci](#):
>
> read up on Python socket comms!

I would not recommend python sockets in a jython environment. You should use java sockets in jython.
