# Generating sting tag from ascii code of its characters

**URL:** <https://forum.inductiveautomation.com/t/generating-sting-tag-from-ascii-code-of-its-characters/19958>\
**Category:** Ignition\
**Created:** [October 3, 2018, 3:03pm UTC](https://forum.inductiveautomation.com/t/generating-sting-tag-from-ascii-code-of-its-characters/19958 "2018-10-03T15:03:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![claudio](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@claudio](https://forum.inductiveautomation.com/u/claudio)\
**Post date:** [October 3, 2018, 3:03pm UTC](https://forum.inductiveautomation.com/t/generating-sting-tag-from-ascii-code-of-its-characters/19958/1 "2018-10-03T15:03:05Z")

</div>

Hello  
I have 4 byte tags that contain values like:  
TEST\_BYTE\_1 = 53  
TEST\_BYTE\_2 = 48  
TEST\_BYTE\_3 = 71  
TEST\_BYTE\_4 = 70

these are ascIi codes of a chars 5, 0, G, F

How can I generate an expression string tag that is the concat of these characters so that the result would be "50GF  
" ?

I tried chr() function (cancat(chr({[.]TEST\_BYTE\_1}), chr({[.]TEST\_BYTE\_2}), chr({[.]TEST\_BYTE\_3}), chr({[.]TEST\_BYTE\_4}))  
) but it doesn’t work in the expression panel of my expression tag

Can you help me?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 3, 2018, 3:11pm UTC](https://forum.inductiveautomation.com/t/generating-sting-tag-from-ascii-code-of-its-characters/19958/2 "2018-10-03T15:11:24Z")

</div>

There is no `chr()` function within Ignition’s expression language. You could add a shared script like this:

```auto
def from_ascii(*args):
	buf = []
	for arg in args:
		buf.append(chr(arg))
	return ''.join(buf)

```

Then call it in your expression tag:  
`runScript("shared.decode.from_ascii", 0, {[.]TEST_BYTE_1}, {[.]TEST_BYTE_2}, {[.]TEST_BYTE_3}, {[.]TEST_BYTE_4})`
