isAlarmActive with polling rate

I feel like maybe I am missing something here, but when I try to use the isAlarmActive expression with a polling rate as a binding in perspective, I cant give it a polling rate without it failing. Unfortunately the documentation only shows it with multiple tags, not with a polling rate.

Here is what I have:

isAlarmActive("[MyProvider]MyFolder/MyTagWithAnAlarm", "MyAlarmName", 5000)

Here is the error:

I can force it to poll by doing this, but Its kind of a cheeky workaround

if(now(5000) != "", isAlarmActive("[MyProvider]MyFolder/MyTagWithAnAlarm"), "")
1 Like

From a glance at the code, I think there’s no ability to specify a poll rate on the gateway because it shouldn’t be necessary. On the gateway we should be able to directly hook into the tags with listeners, and get triggered value changes.

So then as a clarification, I am not seeing the binding auto-reevaluate when the alarm is triggered

However it does auto-reevaluate by binding directly to the alarm isActive tag path

so is this part of the user manual a typo then?

isAlarmActive(tagPath, [alarmName], [pollRate])

  • Parameters

String tagPath - The Tag path to search for active alarms. Supports the wildcard ‘*’.

String alarmName - The name of the alarm to search for. Supports the wildcard ‘*’. [optional]

Integer pollRate - The poll rate in milliseconds. Only applicable in the Client scope. [optional]

  • Returns

Boolean - True if an alarm is active; False if no active alarms were found.

Which part?

The part about being able to set a poll rate?

The user manual already states it’s only applicable in Client scope.

Perspective is not “Client” scope. We’ve been making an effort to say “Vision Client” where applicable in the user manual to try to make that more clear, looks like we missed a spot.

ah ok, that makes sense. I didn’t realize the distinction. Is there anyway to add that to perspective? My binding seems to respond when an alarm goes from in-active to active, but when the alarm clears it doesn’t change.

I think Paul’s original point here is that polling isn’t necessary in the gateway. If the binding isn’t behaving properly then it might be a bug.

Is your execution mode currently set to Event Driven?

edit: assuming this is on an Expression Tag

I’m using it on a property binding to set a style class when an alarm is active

I think we already have an issue for this… I’m going to update it and put it in the backlog, hopefully for next sprint.

1 Like

JD, I’m having the same issue. The function works as long as I click apply in the ‘Edit Binding’ window after an alarm state change so there seems to be no automatic polling.

I’m having the same problem. I want to highlight certain urgent alarms by making a slow-flashing style class on the root of the view. One of them is if our main database goes unavailable. It works fine if I bind directly to the tag, but I have a 30 second active delay on it. The transition doesn’t get caught.