npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-cx-alarm-log

v1.1.2

Published

A Node-RED industrial alarm parser for simple HMI applications.

Downloads

37

Readme

Simple Node-RED HMI Alarms Logger node

The Alarm Node (logger) is designed to filter and redirect events/alarms based on CSV config. This node is designed to be used on industrial applications where Node-RED used as HMI (Human Machine Interface).

There are two (2) types of events in this engine:

  • Alarms - an event which has a trigger condition, start timestamp and duration. Alarm can be in two states: active and cleared.
    • Info
    • Warning
    • Fault
  • Events - an event which has a trigger condition and start timestamp. Event can be only added.

Node outputs:

  1. Added or Modified alarms
  2. Added events
  3. Current settings

Node Usage

An example of its usage https://node-red-dev.controlx.io:5010/ with admin here

Screenshots

Flow Usage: flow usage example

Usage with the UI Table node table usage example

Node config

Name sets a name for the node.

Alarm Topic sets topic for the output 1.

Event Topic sets topic for the output 2.

Config Path sets path to CSV event config. The path can be relative to the Node-RED project folder or an absolute path.

Toggle to parse the config again used to re-parse the CSV config. Used when new config uploaded with the same path.

Debug produces more logs in the console and the debug pane.

Event Config

Event config is in CSV format with metadata. A benefit of CSV config is that you can work on large number of input data (tags from PLC) in one, easy to see, table.

CSV event config example: CSV alarm config example

Incoming messages APIs

Below is type of messages msg accepted by the node

Messages with tag values for alarming

interface IProcessData {
    [tagName1: string]: number | boolean,
    [tagName2: string]: number | boolean,
    [tagNameN: string]: number | boolean,
}
interface msg {
    payload: IProcessData
}

msg example

{
  "payload": {
    "air_pressure": 40,
    "24V_supply_F": true
  }
}

Settings Getters

GET Config

At output 3: Returns the parsed config (from CSV file).

interface msg {
    topic: "__get_config__"
}

GET Active Alarms

At output 3: Returns an object with currently active alarms in the node.

interface msgIn {
    topic: "__get_active_alarms__"
}

GET Setpoints

At output 3: Returns objects with Setpoints parsed from the config.

interface msgIn {
    topic: "__get_setpoints__"
}

GET Remembered Values

At output 3: Returns an object with remembered tag values (not persistent).

interface msgIn {
    topic: "__get_remembered_values__"
}

Settings Setters

SET Active Alarms

This is needed to set internal alarm register. The register used to determine when to clear the active alarms. Without this register on restart the active alarm could be not cleared.

If using external DB, you need to query it for active alarm on Node-RED start.

If not using an external DB, save the node output in the persistent global context, then on Node-RED start use it as an input to this node.

interface IActiveAlarm {
    eventId: string,
    isActive: boolean,
    type: "I",
}
interface msg {
    payload: IActiveAlarm[],
    topic: "__set_active_alarms__"
}

example 'msg. Fields eventId, isActive, type are required only, others are optional.

{
  "payload": [
    {
      "ts": 1641192388240,
      "eqName": "Shot Peener",
      "tagName": "24V_supply_F",
      "triggerCond": {
        "op": "=",
        "val": 1
      },
      "eventId": "24V_supply_F::F::0",
      "isActive": true,
      "type": "F",
      "desc": "24V Supply Fault",
      "id": "24V_supply_F::F::0::1641192388240"
    },
    {
      "eventId": "elevators_running::I::0",
      "isActive": true,
      "type": "I"
    }
  ],
  "topic": "__set_active_alarms__"
}

SET Setpoints

Set Setpoins dynamically based on the tag name in the curly brackets in the CSV config.

interface ISetpoint {
    [tagName1: string]: number | boolean,
    [tagName2: string]: number | boolean,
    [tagNameN: string]: number | boolean,
}
interface msg {
    payload: IActiveAlarm[],
    topic: "__set_active_alarms__"
}

example 'msg

{
  "payload": {
    "pr_SP": 12,
    "air_pr_HiLim": 44
  }
}