# Change label name every hour

**URL:** <https://forum.inductiveautomation.com/t/change-label-name-every-hour/52547>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [November 1, 2021, 4:38am UTC](https://forum.inductiveautomation.com/t/change-label-name-every-hour/52547 "2021-11-01T04:38:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vani161998](https://avatars.discourse-cdn.com/v4/letter/v/ee7513/32.png) [@vani161998](https://forum.inductiveautomation.com/u/vani161998)\
**Post date:** [November 1, 2021, 4:38am UTC](https://forum.inductiveautomation.com/t/change-label-name-every-hour/52547/1 "2021-11-01T04:38:46Z")

</div>

hi,  
I have four status like A,B,C,D. when a tag value changes to true, the status has to change to A. After 2hrs it should automatically change to B. Like this for every 2hrs it has to change to next status. Can i do like this? any solution?

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [November 1, 2021, 7:26am UTC](https://forum.inductiveautomation.com/t/change-label-name-every-hour/52547/2 "2021-11-01T07:26:06Z")

</div>

A lot of possible solutions. The fact you tagged Vision forces me to give addition explanation.  
None of the delays or tag changes should be based on Vision/Client Scope. Everything should be done at the gateway.

The simplest solution is by using [system.util.sendMessage - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.util.sendMessage) inside a tag value change script. Make sure to create a gateway scope message handler.

When `currentValue.value == True` send the message handler, Also write ‘A’ to that state tag…  
Inside the message Handler script you may wanna import  
`from` `threading ` `import` `Timer ` or `from` `time ` `import` `sleep` as shows in [Adding a Delay to a Script - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/Adding+a+Delay+to+a+Script) to add 2hrs delay. With each delay write the new state.

Gateway Timer or Scheduled Scripts may also be a good option, but I don’t think is beneficial in your case.

Mentioning Scheduled Script, if any IA person can confirm if problems were already fixed?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 1, 2021, 11:44am UTC](https://forum.inductiveautomation.com/t/change-label-name-every-hour/52547/3 "2021-11-01T11:44:43Z")

</div>

Expression tag:  
EDIT Sorry, just noticed I didn’t actually post it. 🙄

```auto
if({[~]BoolTag},
	case(floor(secondsBetween({[~]BoolTag.Timestamp}, now()) / 2), 
		 0, 'A',
		 1, 'B',
		 2, 'C',
		 3, 'D',
		 'Error'
		),
	'Idle'
   )

```
