Agent Tag Change Notification Traps

The SNMP Agent provides a custom trap type for sending tag change notifications to the management server. IO tags will automatically publish via SNMP when Destination tags are specified. Custom code is required to send a change notification, but this can be done from a simple child tag that watches the parent value, or from an application service module. This provides maximum flexibility as to when and how the notifications are sent.

\SNMPAgent\NotifyTagChange

Description:

Sends a notifyTagChange trap to the configured trap destination.

Returns: Boolean error indication.
Usage:

Subroutine

Format:

SNMPAgent\NotifyTagChange(TagName[, NeedAck, Fields])

Parameters:

TagName
Required. Name of the tag to send the notification for
NeedAck
Optional. Any Boolean expression. Set TRUE if acknowledge is required or FALSE to send unacknowledged trap. Defaults to FALSE.
Fields
Optional. An array of field names to send in trap/inform PDU. Defaults to (Timestamp, Value, Quality). See available field names under Agent Tag Fields.
Comments:

This sends a notifyTagChange trap to the configured trap destination. By default the SNMP Agent notification subsystem will only send notification from the current server.
The option SNMPAgentTagNotifyMode can adjust this behavior as needed. The name of the RPC service for notifications is "SNMP Agent Notifications", which can be configured like any other VTScada RPC service.

If the SNMP Agent Notifications service server changes then a notifyServerChange trap will be sent from the new server. The management system can choose to poll for the current tag values whenever this occurs, as notifications may have been missed during the transition period.

The following custom appNotifyInfo MIB objects also provide some useful information.

  • notifyServer(1) - 1 if this is the current notification server
  • notifyFailCount(2) - count of notifications that did not receive an acknowledge (after retries).
  • lastNotifyFailUTC(3) - UTC timestamp of the last notifyFailCount

A management system relying on notifyTagChange notifications to keep values updated should keep an eye on the fail statistics, polling for current tag values whenever synchronization has been lost as indicated by an increase in the fail count.