# Process to control on Tag change client events

**URL:** <https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [November 16, 2021, 5:41am UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111 "2021-11-16T05:41:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 16, 2021, 5:41am UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/1 "2021-11-16T05:41:30Z")

</div>

Hi i am stuck in some process of tag change script.  
First thing first, We don’t have any PLC and want to control the process on memory tags.  
So i have one tank filled which i need to empty and transfer it to other tank. so there are some steps which need to be satisfied for the production process to complete which i am attaching below. So when i click on prod transfer start button, process start to step 1 checks the condition for step1 and goes to step2 check again step2 condition and goes on till step6.  
I am controlling this from one tag of prod transfer start button but i am stuck in between on how to control the process based on steps. I have attached process image.

 ![process](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/5/857f5f5bcf850c884812e1d51e7b81377743123e.png)

---

<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:** [November 16, 2021, 1:04pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/2 "2021-11-16T13:04:56Z")

</div>

If you want to control like a PLC, you should execute like a PLC: Use a relatively fast timer event that checks all state every cycle and makes any necessary tag writes.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 16, 2021, 1:09pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/3 "2021-11-16T13:09:03Z")

</div>

No, I don’t have any PLC right now so i am controlling through memory tag.

---

<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 16, 2021, 1:29pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/4 "2021-11-16T13:29:20Z")

</div>

You misunderstood, I think. Phil is saying to execute _ **like** _ a PLC would.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 16, 2021, 1:43pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/5 "2021-11-16T13:43:37Z")

</div>

I dont have any idea on fast timer event. can you elaborate more on this and some solution.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 16, 2021, 6:09pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/6 "2021-11-16T18:09:32Z")

</div>

They’re probably talking about a script running on Scripting\>Gateway Events\>Timer so it runs periodically and checks your current step and executes the necessary procedures, kinda like a PLC would

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/269f62e66e73f7722035f99c25b7628f7112e3dd.png)

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 24, 2021, 3:08pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/7 "2021-11-24T15:08:30Z")

</div>

Hi All, thanks for the inputs. I am able to solve the issue from timer tag. However i am stucking in write value to tag on read condition. can anyone solve this.

read = system.tag.readBlocking([’[default]FB\_process/Test\_tags/Finalised’])[0]  
print read.value  
print read.quality  
print read.timestamp

if read == 1:  
system.tag.writeBlocking([’[default]FB\_process/Test\_tags/prechecks’], [‘TRUE’])

I am able to read value but not able to write to it based on condition

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 24, 2021, 3:47pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/8 "2021-11-24T15:47:27Z")

</div>

Maybe change  
`if read ==1:`  
to  
`if read.value == 1:`

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 24, 2021, 4:59pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/9 "2021-11-24T16:59:45Z")

</div>

Still not worked. but when i change the condition to  
if read != 0:  
then write function works but for equal to operator it is not working.

---

<div class="post-metadata">

**Author:** ![leonardo.godoi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/leonardo.godoi/32/27178_2.png) [@leonardo.godoi](https://forum.inductiveautomation.com/u/leonardo.godoi)\
**Post date:** [November 24, 2021, 5:01pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/10 "2021-11-24T17:01:52Z")

</div>

Weird way to to work, what do you get on your `print read.value` ?

---

<div class="post-metadata">

**Author:** ![Sourabh\_Ambildhuke](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@Sourabh\_Ambildhuke](https://forum.inductiveautomation.com/u/Sourabh_Ambildhuke)\
**Post date:** [November 24, 2021, 5:39pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/11 "2021-11-24T17:39:30Z")

</div>

Hi leonardo, it is done on read.value. Thanks for this

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [November 24, 2021, 6:10pm UTC](https://forum.inductiveautomation.com/t/process-to-control-on-tag-change-client-events/53111/12 "2021-11-24T18:10:44Z")

</div>

> [@Sourabh\_Ambildhuke](#):
>
> system.tag.writeBlocking([’[default]FB\_process/Test\_tags/prechecks’], [‘TRUE’])

I assume that this prechecks tag is intended to either have a value of 'TRUE' or 'FALSE', if so you should make it a booleen type and just write either True or False to it.

```auto
system.tag.writeBlocking(['[default]FB_process/Test_Tags/prechecks'],[True])

```
