Skip to main content
Version: v4 (Stable)

SetEventCondition

SetEventCondition(AlarmId As String/Integer, nCondition As Integer, sThreshold As String[, nValueType As Integer])

Sets the event condition for the alarm tag identified by <AlarmId>. <AlarmId> can be the numeric object Id of the tag or its alphanumeric identifier depending on the type of the parameter (Integer or String).

The condition type is given in <nCondition> with the following possible values:

  • 0 = No acknowledgment
  • 1 = Event if not equal
  • 2 = Event if equal
  • 3 = Event if higher
  • 4 = Event if lower
  • 5 = Event if higher or equal
  • 6 = Event if lower or equal
  • 7 = Event if logical and true
  • 8 = Event if logical and false
  • 9 = Event if variation higher
  • 10 = Event if variation lower

The event threshold is set by <sThreshold>, it depends of the condition type.

The <nValueType> parameter sets the tag value type (numeric or string):

  • 0 = auto (default) the value type depends of the <sThreshold> value type
  • 1 = numeric type
  • 2 = string type

Returns a non null value if succeeded (6 = undefined alarm).