Data Point - No Update "Alarm"
-
I want to monitor data point to determine whether the point is updating.
If it's not updating, I will show a "No Communication" alarm on a dashboard. If it is. I will show a "Communication Ok".
The last time I worked on this Phil was giving me a hand with a script to do so.
In this example, the data point used is BoilerMember1 - Alarm Status. As you can see from the following screenshot, it is updating every 10 seconds:
However, this script, which is supposed to monitor that point, does not work. It always shows a value of 1 (No Communication).
Does anyone know what is wrong with this script?
-
@mihairosu for a start let's see what values you are inserting into that method:
print( new Date() - 60000)
if it's nonsensical, it might mean it needs altering slightly:
print( (new Date()).valueOf() - 60000); //Edit sorry, mistype
See what you get first
Fox
-
Here's what I get:
print(data); = []
print( new Date() - 60000); = 1676922919700
print(new Date().valueOf - 60000); = NaN -
@mihairosu Heya: Is there a reason you're not using the "no update" event style type built into the Mango event creation stuff? That will let you just let Mango do that- We use these alarms extensively to detect "stuck" data points:
-
@Turbo It's been a while since I've re-visited our Mango installation.
We did have an event handler for this, but I want to be able to pull this event handler as a data point into a dashboard.
I don't think the event handler create a data point that I can reference from what I can tell.
I just deleted and re-created this event detector, but it did not create a new data point.
-
@mihairosu Yeah- The event handlers don't create new points, but you should be able to use the event list right in your dashboard- I've never done this, but it seems like it should be possible.
-
@mihairosu Now that I mention that- If you just show the value, in the dashboard, the Event handler little <!> symbol will show up next to it if it gets stuck. At least, it does on our values in the dashboard that have an event created.
-
If I may, if having a point show on the dashboard is critical, use the aforementioned event handler Turbo described and on active and off use it to set a virtual datapoint to true and false, then display that point as you desire.
Fox
-
@Turbo Ah I see. Well my final goal is to change the color of a dashboard element but I'm going about it step by step, and seeing if there's any other way.
Our dashboards are displayed on some screens, but I'll have to test and see how they look when they're not updating.
-
@MattFox Ooooohhh that would work, yes. I think I like this method.
-
@mihairosu I guess I already have these meta data points existing.
How do I delete the existing script so I can just set it using the event handler?
I can't seem to be able to simply delete the script and save the point.
-
@mihairosu For a metapoint, you need something in the script- You can just return the input value- Set variable name to my, set your input to update the context, and then just "return my" in the script body. This creates an empty meta point that just returns the value that you originally put into it.
-
- Create your virtual datapoint
- Go to the datapoint list in the datasource page for the datapoint you are monitoring
- Click on the menu at the far right on the datapoint in question and select event handlers,
- set event type to no update
- add the type to set point and choose your virtual datapoint
-
@Turbo
this is new feature. -
@mihairosu
new Date() returns a date object.
The method requires a timstamp pointValuesSince(timestamp, cache): PointValueTime[],I didnt have the time to test this but this is what I think you script should be:
var now = Date.now() //returns the timestamp of now var minuteAgo = now - 60000//the timestamp of 1minute ago var data = p.pointValuesSince(minuteAgo, true); if(data.length > 0) return 0 return 1
-
Thank you everyone.
I was able to figure out that I needed to create the Event Detectors / Handlers and Virtual Points on the same device on which the data originates (a remote MangoGT). Then I can push the virtual data points I am interested in to our central server.
I was trying to do this on our central server, and create an event detector on one of the points being synced via persistent TCP sync, but it was not working there.
-
I am having issue with the "No Update" event detector. It seems to be malfunctioning.
This is on Mango v3: core 3.7.12.
Here's what I'm trying to do:
This same logic is applied to 5 different points, but some of them (currently 2) seem to be malfunctioning. I am showing an example of 1 of 2 that are not working at this moment.
Here is the device: BoilerMember3 and the data points.
The event detector is located on Alarm Status. As can be seen, the point is being updated every 15 sec and the most recent data is from 15:18:00, which is up to date, as seen on this screenshot.
The alarms page shows that this point's event detector, which is No Update, has been Active for 1.21 days ago, because of "target point is missing or disabled":
Data point is enabled:
Event detector is set:
Event handler is set to change a virtual data point:
Configuration of the virtual data point:
However, as can be seen in the first screenshot, this data point is now set as Active and this "Communication Failed", but this is incorrect because the Alarm data point has recent data and has been updating properly.
-
@mihairosu your event types are set to no change in that picture. If the value is the same then alarm will be triggered.
Fox
-
@mihairosu ye as @MattFox mentioned your current detector only looks for a change in value, using a no update is what you should be using. An update is considered a successful poll for polling data sources or a successful parse of a new value for listening data sources even if the point does not get logged.
-