# TCP Message Tag manipulation

**URL:** <https://forum.inductiveautomation.com/t/tcp-message-tag-manipulation/31862>\
**Category:** Ignition\
**Created:** [February 3, 2020, 1:46pm UTC](https://forum.inductiveautomation.com/t/tcp-message-tag-manipulation/31862 "2020-02-03T13:46:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craighunter1986](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Craighunter1986](https://forum.inductiveautomation.com/u/Craighunter1986)\
**Post date:** [February 3, 2020, 1:46pm UTC](https://forum.inductiveautomation.com/t/tcp-message-tag-manipulation/31862/1 "2020-02-03T13:46:23Z")

</div>

Hi,

I am connecting a Mettler Toledo Scale with an RS232 via a Serial to Ethernet device. I have then connected the device to Ignition using the TCP driver and started to poll the Message tag for the weight being displayed. This works but I am receiving a string with characters that I don’t require. I am only really looking for the numbers and not the text.

example:

Whats I am getting - _S S 31.1g_

What I would like - _31.1_

I have looked at transform I but couldn’t see anyway to do this, any advice?

Thanks

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 3, 2020, 2:54pm UTC](https://forum.inductiveautomation.com/t/tcp-message-tag-manipulation/31862/2 "2020-02-03T14:54:38Z")

</div>

You can most likely edit what the nature of the message is at device level through print settings. If that doesn’t work. You could get the expected output with a script. The S is maybe stable? This was my experience integrating Ohaus scales.

---

<div class="post-metadata">

**Author:** ![Craighunter1986](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@Craighunter1986](https://forum.inductiveautomation.com/u/Craighunter1986)\
**Post date:** [February 3, 2020, 3:57pm UTC](https://forum.inductiveautomation.com/t/tcp-message-tag-manipulation/31862/3 "2020-02-03T15:57:30Z")

</div>

thanks Wking. the setting on the scales seem quiet basic and couldn't see any print settings to adjust.

After multiple searches I came across the below link and managed to create and expression tag based on the OPC tag. Not sure if it is the best solution, but it works!

> [@Casting String to Integer with Expression](http://forum.inductiveautomation.com/t/casting-string-to-integer-with-expression/26233):
>
> If I have an OPC tag that returns a string and I would like to convert it to an integer then what is the expression statement to do this? For example, if the strings look like any one of these: 0.0? 125.0? 99.5? I would like to convert them to the following float values 0.0 125.0 99.5 The ‘?’ is part of what the device returns. I used the replace function to remove the ‘?.’ I used the replace function to remove the ‘.’ and then cast it to integer and float but I get an evaluation error. …
