Alarm added with no name causes annoying errors to remedy

I solved this issue and did not see it in the forms, unless I missed it, but wanted to make others aware just in case.

I was updating alarms and making sure I did not have any overrides that were not supposed to be there. (Old way was to update configs using all the configs, I have grown a bit)

That said I forgot to put the alarm name in the alarm build and several things happened:

  1. All the alarms disappeared and reappear randomly.
  2. You can not delete it from the designer
  3. Solve this by download the Json file and then manually deleting the no name alarms and importing it back
    4 I get this error message:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

The code below is the set up, I added the tag name as need but the part I was missing will look like this
** alarm['name'] = alarmName **.
If missing the problem will occur again.

	for browse in browseTags:
		tagPath = browse['fullPath']
		tagName = browse['name']
		Topfolder = str(tagPath).rsplit("/",1)[0]
		configs = system.tag.getConfiguration(tagPath, False)
		# iterate through the UDTs
		for config in configs:
	        # get alarms for current config
			configAlarms = config.get('alarms',[])
	        # iterate through each alarm one by one
			for configAlarm in configAlarms:
	            #varibale set up for SetpointA
				alarmName = configAlarm.get('name',"")
				setPointA = "[.]" + tagName + "." + alarmName + "_Setpoint"
				setPointAValue = {"bindType": "Expression","value": setPointA}
	            # conditions if needed
				if ("Float" in str(browse['dataType']) or "Int" in str(browse['dataType'])) and (str(browse['name']) != "DIGITAL" and str(browse['name']) != "ANALOG_VALUE" and alarmName != "OUT_OF_RANGE"):
					alarm = {}
					alarm['setpointA'] = setPointAValue
					alarm['displayPath'] = displayPath
					**alarm['name'] = alarmName**
					tag = [{
							'alarms':[alarm],
							'name':tagName
							}]
		            # after all alarms have config chnages on the current path update them and move to the next tag path
					system.tag.configure(Topfolder, tag, collisionPolicy)

A null pointer exception is always a bug. You should report this to support.

3 Likes

Thank you. I have sent this to support.