Hello everyone,
I need your help to create a script that allows me to configure an alarm for an OPC tag and modify its properties. Specifically, the properties I need to be able to modify include:
- Name
- Priority
- Display path
- and other specific properties.
Currently, I managed to create a memory tag from scratch with this script:
# The provider and folder the Tag will be placed at.
baseTagPath = "[default]MyFolder"
# Properties that will be configured on that Tag.
tagName = "myNewTag"
opcItemPath = "ns=1;s=[Simulator]_Meta:Sine/Sine0"
opcServer = "Ignition OPC-UA Server"
valueSource = "opc"
sampleMode = "TagGroup"
tagGroup = "Default"
# Configure the tag.
tag = {
"name": tagName,
"opcItemPath" : opcItemPath,
"opcServer": opcServer,
"valueSource": valueSource,
"sampleMode" : sampleMode,
"tagGroup" : tagGroup
}
# Set the collision policy to Abort. Thus, if a Tag already exists at the base path,
# we will not override the Tag. If you are overwriting an existing Tag, then set this to "o".
collisionPolicy = "a"
# Create the Tag.
system.tag.configure(baseTagPath, [tag], collisionPolicy)
My problem is that I need to modify an existing tag, not create one from scratch.
Could someone provide an example script or point me in the right direction to develop this? Any suggestions or resources would be greatly appreciated!
Thank you very much in advance!