# Keyence SR-L100 message value used in an expression

**URL:** <https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [August 19, 2026, 3:33pm UTC](https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833 "2026-08-19T15:33:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vince\_Schreffler](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@Vince\_Schreffler](https://forum.inductiveautomation.com/u/Vince_Schreffler)\
**Post date:** [August 19, 2026, 3:33pm UTC](https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833/1 "2026-08-19T15:33:47Z")

</div>

When I try to create an expression tag using the Message tag from the SR-L device, I get a false value for the expression even if the expression should be true.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eeff9a3e925a72d4dceff9e943425851c35eb853.png)

If I replace the {[~]SR\_L Gallon/9004/Message} tag with a SQL tag that has the same string value as the Message tag, the expression tag will go True.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1bcf3f4ae2a1df6e9b58792571bde4f721d85ea2.png)

The expression statement should be the 2 tags shown above in the expression equaling each other

---

<div class="post-metadata">

**Author:** ![bobby.miller](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bobby.miller/32/85153_2.png) [@bobby.miller](https://forum.inductiveautomation.com/u/bobby.miller)\
**Post date:** [August 19, 2026, 3:49pm UTC](https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833/2 "2026-08-19T15:49:32Z")

</div>

White space issue?

```python
trim(toString({[~]SR_L Gallon/9004/Message})) = trim(toString({Your SQL Tag}))

```

Other things: `\r` or `\n`? Try `replace()` to see if that does it

---

<div class="post-metadata">

**Author:** ![Marcus\_Sysum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marcus_sysum/32/57944_2.png) [@Marcus\_Sysum](https://forum.inductiveautomation.com/u/Marcus_Sysum)\
**Post date:** [August 19, 2026, 4:06pm UTC](https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833/3 "2026-08-19T16:06:08Z")

</div>

It looks the string is 13 characters but your byte array is 14, I would check your delimiter settings in the tcp driver and verify if the device is sending a `\n` vs `\r\n` . you can also look in the byte array and see which value is extra.

---

<div class="post-metadata">

**Author:** ![Vince\_Schreffler](https://avatars.discourse-cdn.com/v4/letter/v/7ab992/32.png) [@Vince\_Schreffler](https://forum.inductiveautomation.com/u/Vince_Schreffler)\
**Post date:** [August 19, 2026, 4:47pm UTC](https://forum.inductiveautomation.com/t/keyence-sr-l100-message-value-used-in-an-expression/116833/4 "2026-08-19T16:47:51Z")

</div>

Thank you.

I did try the trim expression.

I did not have any settings in the TCP driver under Message Delimiter.

I added a \n to fix the issue and kept the trim expression in.

If it working, don't fix it!
