# OPC tag that's in a Expression tag using case

**URL:** <https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [March 5, 2020, 3:54pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839 "2020-03-05T15:54:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgonya](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgonya/32/9304_2.png) [@jgonya](https://forum.inductiveautomation.com/u/jgonya)\
**Post date:** [March 5, 2020, 3:54pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839/1 "2020-03-05T15:54:17Z")

</div>

I have an string expression tag that has a lot of inserted OPC tag using a case function, something like this in the expression.

case({[default]Seq100},  
1, “IDLE / GROUND STATE”,  
40, “MOTORS RUNNING”,  
50, “SYSTEM FILL INITIATED”,  
1000, “CHECK START UP”,  
1105, concat(“START UP - WAITING [”, {[.]Seq\_Time/T1105\_Minutes},"min "),  
1106, “START UP - INCREASE FLOW TO 100%”,  
1107, concat(“START UP - WAITING [”, {[.]Seq\_Time/T1107\_Minutes},"min "),  
1200, “START UP”,  
1203, concat(“START UP - WAITING [”, {[.]Seq\_Time/T1203\_Minutes},"min "),  
…  
and so on

If OPC tags [.]Seq\_Time/T1107\_Minutes, [.]Seq\_Time/T1107\_Minutes and [.]Seq\_Time/T1203\_Minutes have a leased scan group. Will the tags use the leased rate when the case is not on them? So if [.]Seq\_Time/T1107\_Minutes is a leased mode tag with 30,000 as the rate and 1,000 as the leased/driven rate and if Seq100 = 40. What rate will ignition pull the tag from the OPC?

Thanks for your help,

---

<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:** [March 5, 2020, 4:29pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839/2 "2020-03-05T16:29:07Z")

</div>

If I recall correctly, the `case()` expression function evaluates all of its arguments all of the time, so those tags will probably be leased all of the time.

(Or you could just test it…)

---

<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:** [March 5, 2020, 4:36pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839/3 "2020-03-05T16:36:31Z")

</div>

I’m pretty confident _all_ expression functions evaluate all of their arguments all of the time. There’s no true short-circuiting like a ‘real’ programming language; for instance:  
`if(true, 1, getSecond(now(1000)))` will always poll at a 1 second rate, even though the false condition could never be reached.

---

<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:** [March 5, 2020, 4:39pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839/4 "2020-03-05T16:39:30Z")

</div>

Well, the author of an expression function could fail to call execute() on selected arguments passed in…

(:

---

<div class="post-metadata">

**Author:** ![jgonya](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgonya/32/9304_2.png) [@jgonya](https://forum.inductiveautomation.com/u/jgonya)\
**Post date:** [March 5, 2020, 4:41pm UTC](https://forum.inductiveautomation.com/t/opc-tag-thats-in-a-expression-tag-using-case/32839/5 "2020-03-05T16:41:35Z")

</div>

Thank you for the info. I was hoping that wasn’t the case.
