i’m trying to evaluate if there is something in a text box or not on a property change. if there is something greater than 0 I want to write a ‘true’ or 1 to a Boolean tag in my UDT. I cannot seem to get this to write if I select it as bound template tag. I get an error saying tag does not exist. I can write the value fine if I put the tag in the script editor directly. below is an example of what I am trying to achieve.
this is with a custom property. i’ve tried with or without the “” around tag. my custom property is bound to my template UDT tag on the page. I’ve also tried not defining ‘tag’ and putting ‘event.source.tag’ directly into the system.tag.write() statement.
tag = event.source.Tag
if event.source.text != "":
system.tag.write( "tag" ,1)
if event.source.text == "0":
system.tag.write( "tag" ,0)
if event.source.text == "":
system.tag.write( "tag" ,0)
I’ve also tried writing directly to my UDT tag as shown below. I get the same “tag not found error”
if event.source.text != "":
system.tag.write( "event.source.parent.Receving_Bay.PLCTruckRoute" ,1)
if event.source.text == "0":
system.tag.write( "event.source.parent.Receving_Bay.PLCTruckRoute" ,0)
if event.source.text == "":
system.tag.write( "event.source.parent.Receving_Bay.PLCTruckRoute" ,0)
below is an example of what I have working currently. the problem is I need to create 2 screens one to write to bay1 and one to write to bay2. (not really a problem just a nuisance)
if event.source.text != "":
system.tag.write("Tag/SAP/Receiving_Bay1/PLCTruckRoute",1)
if event.source.text == "0":
system.tag.write("Tag/SAP/Receiving_Bay1/PLCTruckRoute",0)
if event.source.text == "":
system.tag.write("Tag/SAP/Receiving_Bay1/PLCTruckRoute",0)
any ideas?