Perspective - AlarmStatusTable - Visibility on Acknowledge Button Click Event

Absolutely NOT recommending this as a solution, but you can add events to the acknowledge button using Periscope's Portal component.

This is an example of adding an onclick event to the Acknowledge button that sends a message, which a handler responds to by displaying/printed the selected alarms.

Again, do not do this. Trying to reset latching control system alarms using Ignition alarm acknowledgement is not a good idea. Just because they both use the word "Alarm" doesn't make them the same thing.

View Configuration
{
  "custom": {},
  "params": {},
  "props": {},
  "root": {
    "children": [
      {
        "meta": {
          "name": "Portal"
        },
        "position": {
          "height": 300,
          "width": 300,
          "x": 327,
          "y": 562
        },
        "props": {
          "element": "() \u003d\u003e document.getElementById(\u0027alarmTable\u0027)?.querySelector(\u0027.ackAlarmsButton\u0027)",
          "events": {
            "target": {
              "lifecycle": {
                "onMount": "(target) \u003d\u003e {\n\n  target.onclick \u003d () \u003d\u003e {\n\n    console.log(\u0027clicked\u0027)\n    perspective.sendMessage(\u0027alarmAcked\u0027, {}, \u0027view\u0027)\n  }\n\n}"
              }
            }
          }
        },
        "type": "embr.periscope.embedding.portal"
      },
      {
        "meta": {
          "domId": "alarmTable",
          "name": "AlarmStatusTable"
        },
        "position": {
          "height": 380,
          "width": 585,
          "x": 42,
          "y": 53
        },
        "props": {
          "selection": {
            "active": {
              "data": [
                {
                  "ackNotes": "",
                  "ackPipeline": "",
                  "ackTime": "2025-04-06 21:59:08.275+0000",
                  "ackUser": "bmusson",
                  "activePipeline": "",
                  "activeTime": "2025-04-06 21:59:03.703+0000",
                  "clearPipeline": "",
                  "clearTime": "",
                  "deadband": "0.0",
                  "displayPath": "Alarms/Alarm/Alarm",
                  "eventId": "97d4eb7d-084a-4305-babc-65392a802b34",
                  "eventTime": "2025-04-06 21:59:08.275+0000",
                  "eventValue": "true",
                  "isAcked": "true",
                  "isActive": "true",
                  "isClear": "false",
                  "label": "Alarm",
                  "name": "Alarm",
                  "notes": "",
                  "priority": "Medium",
                  "source": "prov:default:/tag:Alarms/Alarm:/alm:Alarm",
                  "state": "Active, Acknowledged"
                }
              ]
            }
          }
        },
        "scripts": {
          "customMethods": [],
          "extensionFunctions": [
            {
              "enabled": false,
              "name": "filterAlarm",
              "script": null
            },
            {
              "enabled": false,
              "name": "filterShelvedAlarm",
              "script": null
            }
          ],
          "messageHandlers": [
            {
              "messageType": "alarmAcked",
              "pageScope": false,
              "script": "\tsystem.perspective.print(self.props.selection.active.data)\n\t\n\tself.getSibling(\"Label\").props.text \u003d self.props.selection.active.data",
              "sessionScope": false,
              "viewScope": true
            }
          ]
        },
        "type": "ia.display.alarmstatustable"
      },
      {
        "meta": {
          "name": "Label"
        },
        "position": {
          "height": 32,
          "rotate": {
            "anchor": "25% 25%"
          },
          "width": 50,
          "x": 96,
          "y": 486
        },
        "props": {
          "text": [
            {
              "ackNotes": "",
              "ackPipeline": "",
              "ackTime": "",
              "ackUser": "",
              "activePipeline": "",
              "activeTime": "2025-04-06 21:59:03.703+0000",
              "clearPipeline": "",
              "clearTime": "",
              "deadband": "0.0",
              "displayPath": "Alarms/Alarm/Alarm",
              "eventId": "97d4eb7d-084a-4305-babc-65392a802b34",
              "eventTime": "2025-04-06 21:59:03.703+0000",
              "eventValue": "true",
              "isAcked": "false",
              "isActive": "true",
              "isClear": "false",
              "label": "Alarm",
              "name": "Alarm",
              "notes": "",
              "priority": "Medium",
              "source": "prov:default:/tag:Alarms/Alarm:/alm:Alarm",
              "state": "Active, Unacknowledged"
            }
          ]
        },
        "type": "ia.display.label"
      }
    ],
    "meta": {
      "name": "root"
    },
    "type": "ia.container.coord"
  }
}
2 Likes