createNotification()

The function creates a notification.

Synopsis

int createNotification(mapping options);

Parameter

Parameter Description
options The notification that is shown. The following option keys are currently possible:
  • title(string) (default:"WinCC_OA") - Sets the first line of text in the platform notification template
  • text(string) - Sets the second line of text in the platform notification template
  • info(string) - A small piece of additional information pertaining to this notification
  • time(time) - Adds a timestamp pertaining to the notification (usually the time the event occurred)
  • sound(string), notification(default), alarm, ringtone - Different standard tones to use (empty = no sound)
  • vibrate(dyn_int) - Sets the vibration pattern to use on mobile devices. Passed in an array of ints which represent the durations for which to turn on or off the vibration in ms. The first value indicates the number of ms to wait before turning the vibration on. The next value indicates the number of ms for which to keep the vibration on before turning it off. Subsequent values alternate between durations in ms to turn the vibration on or off.
  • icon(string) - Relative path of an icon in the pictures dir. Currently used only on Linux

Return Value

The function returns 0 when a notification could be created and -1 when not.

Description

The function creates a notification.

Example

main(mapping event)
{
  mapping options;

  options["title"] = "Important Notification";
  options["text"] = "This is the text of the notification!";
  options["time"] = "2015.10.21 23:58:00.000";

  DebugN(options);

  createNotification(options);
}

Assignment

Miscellaneous functions

Availability

UI