Problem when creating alarmconfig tag from global library

Hello,

I’m using V7.8.0 and I’ve got a problem when I try to create a boolean tag from a global shared module.

following is the script tested with the Console without problem
[i]
[color=#0080FF]Path=“Email/Site1”
Name=“ALM”
value =0

system.tag.addTag(parentPath=Path, name=Name, tagType=“MEMORY”,dataType=“Boolean”, value=value, alarmConfig={"Alarm ":[[“name”, “Value”, "Alarm "], [“setpointA”,“Value”, 1]]})
[/color][/i]

the tag is created with the alarm

so my next step was to create a script that i could call from any project like this in the global shared script library.

[color=#FF0000]d[i]ef EmailTag (Path,Name,value):
Path1 = Path+’/’
Tag=Path1+Name

if system.tag.exists(Tag):
  	system.tag.write (Tag, value)
else:
	system.tag.addTag(parentPath=Path1, name=Name, tagType="MEMORY",dataType="Boolean", value=value, alarmConfig={"Alarm ":[["name", "Value", "Alarm "], ["setpointA","Value", 1]]})[/i][/color]

but something strange happened when i call my module the tag is well created but not the alarm config. Am I missing something ?

Regards

I tried your script and it works perfectly?! Can you tell me if you are seeing any errors? How are you calling your script?

(When you include code on the forum make sure you wrap it in blocks so we can check that your indentation etc. is OK.)

Thanks for your answer

You’re right it’s working and I don’t have any idea why :scratch:. The only thing i did, was to restart the gateway.