I am currently trying to have an email sent if a tag reads in between certain values. I also want the email to contain the machine number that the tags are coming from. I have the machine number set as one of the parameters of the tags. This is the current code I am working with:
if currentValue.value > 5 and currentValue.value < 10 or currentValue.value > 18 and currentValue.value < 20:
body = '{ENumber}' + "had a yellow zone resul of:" + currentValue.value
rec = ['ryan.craig@colder.com']
system.net.sendEmail("smtp.dovercorporation.com", "BurstTesters@colder.com", "Burst Tester Caution", body, 0 , rec)
which is giving me this error:
([default]E398/E398/Test2BurstFinal, valueChanged) Error executing tag event script: Traceback (most recent call last): File "tagevent:valueChanged", line 26, in valueChanged TypeError: cannot concatenate 'str' and 'float' objects
I also tried this code:
if currentValue.value > 5 and currentValue.value < 10 or currentValue.value > 18 and currentValue.value < 20:
body = str({ENumber}) + "had a yellow zone resul of:" + currentValue.value
rec = ['ryan.craig@colder.com']
system.net.sendEmail("smtp.dovercorporation.com", "BurstTesters@colder.com", "Burst Tester Caution", body, 0 , rec)
which is giving me this error:
([default]E398/E398/Test2BurstFinal, valueChanged) Error executing tag event script: Traceback (most recent call last): File "tagevent:valueChanged", line 26, in valueChanged NameError: global name 'E398' is not defined
Any idea how to fix this issue?