alertSet()

Allows data point attributes to be set in a similar way to dpSet().

Synopsis

int alertSet(time t1, int count1, string dp1, anytype value1 [, time t2, ... ]);

Parameters

Parameter Meaning
t1

Time of occurrence

Note that the time parameter must be casted to a atime parameter. See example further below.

count 1 Serial number
dp1 Data point name
value1 Value to be set

Return Value

Returns 0, in the event of a failure returns -1.

Errors

Errors of the related (CTRL) manager can be retrieved with getLastError(). The return value is then the appropriate error code. Errors issued by other managers (Event) can be retrieved with getLastError() only when using waiting functions (see alertSetWait()).

An alert is issued in the event of non-existent data points, incorrect parameter transfers or spelling errors.

Description

Works in a similar way to dpSet(), with certain attributes being able to be set to an alert (to the value valueX). As alerts are not only identified by the associated data point dpX, but also by the time of their occurrence tX, this must also be transferred. It is also possible that several alarms are issued at the same time (for example: group alarm). Alarms of this kind are also assigned a serial number countX.

The attributes and their constants which can be set using alertSet() are described in the chapter _alert_hdl.

Examples

AcknowledgeDpe(string dpe)
{
  int range;
  time t;
  atime At;

// get range of the alert
  dpGet(dpe+":_alert_hdl.._act_range", range);

// get time of the alert
  dpGet(dpe+":_online.._stime", t);

// make time to be of type "atime"
  At = makeATime(t, 0, dpe);

//make sure acknowledging is needed
  if (range != 0)

// single-acknowledge alert
    alertSet(t, getACount(At), dpe+":_alert_hdl."+range+"._ack_state", DPATTR_ACKTYPE_SINGLE);
}
main()
{
  int retVal;
  time t = makeTime(2011,01,19,14,44,03,986);
  bool r;
  retVal  = alertSet( t, 0, "System1:_mp_PUMP1.alert.controlFuse:_alert_hdl.._force_filtered", 1);
  dpGet("System1:_mp_PUMP1.alert.controlFuse:_alert_hdl.._force_filtered", r);
  DebugN("Funktion erfolgreich:", retVal, "ForceFiltered:", r);
}

Assignment

Data point function

Availability

CTRL