System.alarm.shelve performance

Hi guys,

I am using the system.alarm.shelve script in a gateway timer script to hide unwanted alarms. The problem is that this script takes alot of the CPU (between 1.4% and 5%), creating clock drifts. Here is what I see in the gateway log:

ClockDriftDetector	23Feb2018 08:59:04	Clock drift, degraded performance, or pause-the-world detected. Max allowed deviation=1000ms, actual deviation=1814ms

The script runs every 3 seconds, here is the script:

import re

listToShelve = []
stringToShelve = system.tag.read("stringTag").value

if stringToShelve != "":
	for path in re.split("[,;]",stringToShelve):
		if len(path):
			listToShelve.append("*"+path+"*")

if len(listToShelve)>0:
	system.alarm.shelve(path=listToShelve,timeoutSeconds=10)

Have anyone encounter this issue?

Regards,

Philippe

How many alarms are you trying to shelve every 3 seconds? I don't think this a good approach to unwanted alarms. From the docs:

Shelving alarms allows you to temporarily silence an alarm for a fixed period of time. This feature is extremely handy when an alarm is already active and you want to temporarily silence the alarm while you're working on the issue.

Why not simple disable those alarms instead of playing whac-a-mole with them? Barring that, you might consider increasing the timeoutSeconds and rate of the timer event. Or you could create an Alarm Notification Pipeline for those undesired alarms that triggers the automatic shelving.

Get rid of the wildcards.

@bfuson,

we have approximatly 50 alarms that we want to hide. We use this feature to allow the maintenance team to work on our system without showing the alarms to the operator using only a client, so no access to the designer.
Also, I thought at the beginning that using this function would allow us to see the alarms in the shelved section of the Alarm Journal, but we noticed they didn’t appear there just after implementing it. Even the script “system.alarm.getShelvedPaths” doesn’t show the alarms shelved with “system.alarm.shelve”.

I’ll try the automatic shelving with an Alarm Notification Pipeline.

@pturmel,
we use the wildcards because we want to hide the alarm from multiple equipment easily.

If the alarms aren’t active to begin with then your script won’t shelve them. Do you know whether or not they stay shelved if they transition to ‘clear’ while in the shelf? I’m not sure if they do or if they’re evicted…

Seems like you might want to have a Boolean client tag for “maintenance mode”. In your pipeline you can check the status of that tag before deciding to shelve the alarms that are raised.

Yeah, but the "why" doesn't change the fact that you are making system.alarm.shelve() search your entire tag structure for each element in your list.

1 Like

I would classify them as low priority or even diagnostic, then on the alarm summary page just filter for Priority>Diagnostic when normal users are logged in, and remove the filter when Maintenance is logged in.
This way the alarms will still go through normal workflow without the operators having to deal with them.

1 Like

@pturmel
you mean this script look at all the tags each time? Ignition doesn’t have an internal table with all the active alarms?

I don’t know precisely how it works, but no, I don’t think it has an optimized list in gateway memory of active alarms.
You can test this yourself. In the top level of your script module (which runs just once), use the tag browse functions to search the tree and expand your wildcards into a list of tag objects. Then your timed script can iterate that list to find the alarms to shelve, and submit an explicit list to shelve().

@bfuson

I did an alarm pipeline in which I redirected half of the alarm in the project, this caused the gateway to monitor clock drifts again.

After that, I tried to shelve a specific list of alarm like @pturmel suggested. This method works fine from the script console of the designer, but not in a gateway timer script.

Here is the script:

import re

activeAlarms = system.alarm.queryStatus(state = ["ActiveUnacked", "ActiveAcked"],includeShelved = True)
stringToShelve = system.tag.read("[DomInter]AppsConfiguration/BHS/AlarmsToShelve").value
listShelving = []
source = ""
displayPath = ""
alarmsToShelve = []

if stringToShelve != "":
	for word1 in re.split("[,;]",stringToShelve):
		listShelving.append(str(word1))
		
	for alarm in activeAlarms:
		source = str(alarm.getSource())
		displayPath = str(alarm.getDisplayPath())
		
		for word2 in listShelving:
			if source.find(word2) != -1 or displayPath.find(word2) != -1:
				alarmsToShelve.append(source)
				break
		
	system.alarm.shelve(path = alarmsToShelve,timeoutSeconds = 30)

When I run this in a gateway timer script, the ShelfExpiration property doesn’t update.

I think my last resort is to create a custom alarm journal. This will allow me to have full control on what the operators can see.