# Expression Tags Slow

**URL:** <https://forum.inductiveautomation.com/t/expression-tags-slow/36205>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [June 30, 2020, 5:59pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205 "2020-06-30T17:59:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [June 30, 2020, 5:59pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/1 "2020-06-30T17:59:42Z")

</div>

I’m at a customer site that is using 8.0.13 and in the UDT’s for the different devices we have an integer that is coming from the PLC and then an expression string that is generated from that integer number to use throughout the system.

That string expression is evaluating pretty slow and I’m trying to figure out where the bottle neck is and eliminate it.

For a test I have a single memory integer tag and a single string expression tag to test this just to make sure it isn’t in the UDT.

Well low and behold that same delay happens outside of the UDT as in the UDT.

I’ve created it own tag group to test to make sure that the tag group wasn’t causing the issue and the same thing is happening.

Any ideas on where I can start trying to figure out what is going on?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [June 30, 2020, 6:04pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/2 "2020-06-30T18:04:56Z")

</div>

What is the tag group rate at?

---

<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 30, 2020, 6:14pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/3 "2020-06-30T18:14:12Z")

</div>

What is the expression and how are you evaluating that it’s slow?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [June 30, 2020, 6:27pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/4 "2020-06-30T18:27:58Z")

</div>

@jpark  
Doesn’t seem to matter…

@Kevin.Herron

It’s a switch statement. However if I just mimic that value back its the same delay.

This is the statement:

```auto
try(
	switch({[.]TestStatus},
	0,7,9,10,11,20,21,30,100,101,
	'Stopped', // State 0
	'Pre-Start', //State 7
	'Horn', //State 9
	'Starting', //State 10
	'Starting', //State 11
	'Forward', //State 20
	'Reverse', //State 21
	'Stopping', //State 30
	'Hand Forward', //State 100
	'Hand Reverse', //State 101
	'Unknown'), //Falback
	'Unknown'
	)

```

TestSatus is a simple memory tag just for testing sake.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [July 1, 2020, 1:57pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/5 "2020-07-01T13:57:02Z")

</div>

FYI this seems to be tied into another totally separate issue that we are having on this gateway that is causing the gateway to slow to a crawl.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 2, 2020, 3:40pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/6 "2020-07-02T15:40:04Z")

</div>

Just FYI, consider using case statements instead of switch. They’re far more readable and editable

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [July 2, 2020, 6:00pm UTC](https://forum.inductiveautomation.com/t/expression-tags-slow/36205/7 "2020-07-02T18:00:13Z")

</div>

Yeah… that or a lookup is what we are looking at going towards. However some of the text is dynamic, just not shown here, based on the device.

It’s in the pipeline for future work.
