Process to control on Tag change client events

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.

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.

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

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

1 Like

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

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

1 Like

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

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

1 Like

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.

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

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

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.

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