Decorator class for the OaRxJsApi. This class extends the OaRxJsApi and adds additional functionality.

Hierarchy (view full)

Constructors

Properties

emergencyMode$: Observable<EmergencyMode>

Methods

  • Gets alarms inside a time interval

    Parameters

    • startTime: Date

      Start time of the interval from which alarms are returned

    • endTime: Date

      End time of the interval from which alarms are returned

    • dpName: string | string[]

      Name(s) of the alert config(s) to return

    Returns Observable<AlertGetPeriodData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.alertGetPeriod(
    new Date(2019,2,5),
    new Date(2019,2,8),
    'System1:ExampleDP_AlertHdl1.:_alert_hdl.._text'
    )
    .subscribe((data) => console.log(data));

    //query multiple dpe
    oaRxJsApi.alertGetPeriod(
    new Date(2019,2,5),
    new Date(2019,2,8),
    ['System1:ExampleDP_AlertHdl1.:_alert_hdl.._text', 'System1:ExampleDP_AlertHdl1.:_alert_hdl.._prior']
    )
    .subscribe((data) => console.log(data));
  • Looks up pattern in CNS identifiers and IDs

    Parameters

    • pattern: string | string[]

      Pattern to look up in CNS identifiers and IDs

    • includeDps: boolean

      If true, result will also include the Dps matching the returned CNS paths

    Returns Observable<CnsGetCompletionsData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.cnsGetCompletions('*Trend1', true,).subscribe((data) => console.log(data));
    
  • Connects to the API.

    Parameters

    • _baseUrl: string | string[]
    • _token: string
    • _options: ConnectOptions
    • Optional_apiUrl: string
    • Optional_locale: string

    Returns Observable<ConnectData>

    An observable that emits the connection data.

    This method should not be used inside of the HTML widget.

  • connects to heartbeats send from the backend

    Returns Observable<"heartbeat">

    heartbeat Observable

  • Sends a custom command to the WinCC OA wss server.

    Type Parameters

    • T

    Parameters

    • command: string

      Command should be executed.

    • params: LooseObject

      Parameter that are required for the costum command.

    • OptionalunsubCommand: string

      A command that should be send when the Observable is unsubscribed. When default no command is send and the Observable will automatically unsubscribe after one value.

    • OptionalunsubParams: LooseObject

      Parameter that are required for the unsubCommand.

    • Optionaloptions: CustomCommandOptions

      Additional options for the customCommand sent.

    Returns Observable<T>

    An Observable. A subscription is necessary to send the command to the server.

    oaRxJsApi.customCommand<Dashboard[]>('etm.dashboard.list', {}).subscribe(dbs => console.log(dbs));
    
  • @deprecated('use customCommand with options object instead')

    Type Parameters

    • T

    Parameters

    • command: string
    • params: LooseObject
    • OptionalunsubCommand: string
    • OptionalunsubParams: LooseObject
    • OptionaldataKey: string
    • Optionalid: string | number
    • Optionalshared: any
    • Optionaldelay: any
    • OptionalprocessValues: any

    Returns Observable<T>

  • Sends a custom command to the WinCC OA wss server.

    Type Parameters

    • T

    Parameters

    • command: string

      Command should be executed.

    • params: LooseObject

      Parameter that are required for the costum command.

    • unsubCommand: string

      A command that should be send when the Observable is unsubscribed. When default no command is send and the Observable will automatically unsubscribe after one value.

    • unsubParams: LooseObject

      Parameter that are required for the unsubCommand.

    • returnId: ((uuid: string) => void)

      A callback function that returns the ID used for the request.

        • (uuid): void
        • Parameters

          • uuid: string

          Returns void

    • Optionaloptions: Omit<CustomCommandOptions, "id">

      Additional options for the customCommand sent.

    Returns Observable<T>

    An Observable. A subscription is necessary to send the command to the server.

    oaRxJsApi.customCommandSharedId<Dashboard[]>('etm.dashboard.connect', {}, 'etm.dashboard.disconnect', undefined, (uuid) => (console.log(uuid))).subscribe(dbs => console.log(dbs));
    
  • The only difference between this method and customCommand is that this one returns also the connection UUID

    Example :

    oaRxJsApi.customCommandWithId<Dashboard[]>('etm.dashboard.list', {}).subscribe(({ uuid, data }) => console.log(data));
    

    Type Parameters

    • T

    Parameters

    • command: string

      Command that should be executed.

    • params: LooseObject

      Parameter that are required for the custom command.

    • unsubCommand: string = ''

      A command that should be send when the observable is unsubscribed. The default is that no command is send and the observable will automatically unsubscribe after one value.

    • unsubParams: LooseObject = {}

      Parameter that are required for the unsubCommand.

    • Optionaloptions: CustomCommandOptions

      Additional options for the customCommand sent.

    Returns Observable<{
        data: T;
        uuid: string | number;
    }>

    An observable. A subscription is necessary to send the command to the server.

  • Destroys the instance of the class.

    Returns void

  • Disconnects from the API.

    Parameters

    • Optional_disconnectAll: boolean

    Returns void

    This method should not be used inside of the HTML widget.

  • Calls a callback function whenever the passed datapoint values/attributes change.

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element

    • answer: boolean

      Specifies if the callback function should be executed the first time already when the dpConnect() is called or first every time a value changes

    Returns Observable<DpConnectData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.dpConnect('System1:_MemoryCheck.AvailKB:_original.._value', true).subscribe(data => console.log(data));
    
  • Creates an empty subscription and registers the client to receive further updates. First answer is an UUID that is used for other requests. Otherwise dps updates are received.

    Returns Observable<string | DpConnectData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.dpConnectList().subscribe(data => console.log(data));
    
  • Adds one or more DPs to the subscription. DPs that have already been added are ignored. An additional callback is sent to the frontend with the current values of all added DPs.

    Parameters

    • connectUuid: string

      UUID of the corresponding connect request.

    • dpNames: string[]

      List of the DP names to add.

    Returns Observable<dpConnectListAddResponse>

    Object with addedCount

  • Parameters

    • connectUuid: string

      UUID of the corresponding connect request.

    Returns Observable<string[]>

    A list of the DPs currently included in the subscription.

  • Removes one or more DPs from the subscription. DPs that are currently not included in the subscription are ignored.

    Parameters

    • connectUuid: string

      UUID of the corresponding connect request.

    • dpNames: string[]

      List of the DP names to remove.

    Returns Observable<{
        removedCount: number;
    }>

    The number of DPs actually removed from the subscription.

  • Get units of datapoint elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    Returns Observable<DpElementTypeData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpElementType('System1:_MemoryCheck.AvailKB')
    .subscribe((data) => console.log(data)); // long
  • Reads values of datapoint attributes

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element

    Returns Observable<unknown>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.dpGet('System1:_MemoryCheck.AvailKB:_original.._value').subscribe((data) => console.log(data));
    
  • Get aliases of datapoint elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    Returns Observable<DpGetAliasData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetAlias('Pump12.value.RotationSpeed')
    .subscribe((data) => console.log(data));
  • Returns the historic values that were valid at that time

    Parameters

    • time: Date
    • dpName: string | string[]

    Returns Observable<unknown>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetAsynch(new Date(), 'System1:ExampleDP_Trend1.:_original.._value')
    .subscribe((data) => console.log(data));

    //query multiple dpe
    oaRxJsApi
    .dpGetAsynch(new Date(), ['System1:ExampleDP_Trend1.:_original.._value','System1:ExampleDP_Rpt2.:_original.._value'])
    .subscribe((data) => console.log(data));
  • Get descriptions of datapoint elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    • Optionalmode: number

      Description mode (see WinCC OA Help for dpGetDescription()).

    Returns Observable<DpGetDescriptionData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetDescription('Pump12.value.RotationSpeed', null)
    .subscribe((data) => console.log(data));
  • Get output format of datapoint elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    Returns Observable<DpGetFormatData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetFormat('Pump12.value.RotationSpeed')
    .subscribe((data) => console.log(data));
  • Querying DP attributes over a particular time period

    Parameters

    • startTime: Date
    • endTime: Date
    • count: number
    • dpName: string | string[]

    Returns Observable<DpGetPeriodData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetPeriod(
    new Date(2017, 5, 5),
    new Date(2017, 5, 6),
    5,
    'System1:_MemoryCheck.AvailKB:_original.._value'
    )
    .subscribe((data) => console.log(data));

    //query multiple dpe
    oaRxJsApi
    .dpGetPeriod(new Date(2019, 2, 5), new Date(2019, 2, 8), 5, [
    'System1:_MemoryCheck.AvailKB:_original.._value',
    'System1:_MemoryCheck.UsedKB:_original.._value',
    ])
    .subscribe((data) => console.log(data));
  • Get units of datapoint elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    Returns Observable<DpGetUnitData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpGetUnit('Pump12.value.RotationSpeed')
    .subscribe((data) => console.log(data));
  • Returns all the datapoint names or datapoint element names that match a pattern. The datapoint structures are written to the array in alphabetical order

    Parameters

    • dpPattern: string

      Pattern

    • dpType: string

      Data point type. Allows to restrict the returned datapoints to a specific datapoint type. When using the parameter only datapoints that are matching the pattern and the selected datapoint type will be returned.

    Returns Observable<DpNamesData>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpNames('System1:_MemoryCheck.*', null)
    .subscribe((data) => console.log(data));
  • Retrieves attribute values with the help of SQL statements

    Type Parameters

    Parameters

    • query: string

    Returns Observable<T>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpQuery("SELECT '_original.._value' FROM 'ExampleDP_Arg*' WHERE _DPT= \"ExampleDP_Float\"")
    .subscribe((data) => console.log(data));
  • Retrieves attribute values with the help of SQL statements

    Parameters

    • query: string
    • answer: boolean = true

      If true, the callback function is executed the first time already when the dpQueryConnect() is called or first every time a value changes

    Returns Observable<{
        result: DpQueryData;
    }>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi
    .dpQueryConnect("SELECT '_original.._value' FROM 'ExampleDP_Arg*' WHERE _DPT= \"ExampleDP_Float\"")
    .subscribe((data) => console.log(data));
  • Assigns values to datapoint attributes

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element

    • value: unknown

      New Value for the Data Point

    Returns Observable<boolean>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.dpSet('System1:_MemoryCheck.AvailKB:_original.._value', '1234').subscribe(success => console.log(success));
    
  • Reads graphics attribute values for a graphics object in variables

    Parameters

    • shapeName: string

      Name of the graphics object

    • property: string

      Names of the attributes

    Returns Observable<GetValueData>

    An Observable. A subscription is necessary to send the message to the server.

      oaRxJsApi
    .getValue("PUSH_BUTTON1", "foreCol")
    .subscribe((data) => console.log(data));

    //query multiple properties
    oaRxJsApi
    .getValue('PUSH_BUTTON1', ['foreCol', 'text'])
    .subscribe((data) => console.log(data));
  • Set locale to be used for returning langStrings. This can only be used when connected to a WSS server (will raise an error when used inside a WebView EWO)

    Parameters

    • locale: string

      Name of the locale to use *

    Returns Observable<boolean>

    Defines whether the server has accepted the message or not. In order to know if the command was successful use the success/error callback.

    oaRxJsApi
    .setLocale('en_US.utf8')
    .subscribe((success) => console.log(success));
  • The function setValue() sets any number of graphics attributes of a graphics object

    Parameters

    • shapeName: string

      Name of the graphics object as it can be specified in the attribute editor. " " (empty string) addresses its own object

    • propertyName: string

      Name of the basic attribute

    • newValue: unknown

      Parameters that describe the graphics attribute. The number of parameters depends on the graphics attribute

    Returns Observable<boolean>

    An Observable. A subscription is necessary to send the message to the server.

    oaRxJsApi.setValue(
    "Vision_1.yourpanelname.pnl:PUSH_BUTTON1",
    "foreCol",
    "red"
    )
    .subscribe((success) => console.log(success));

    //query multiple properties
    oaRxJsApi.setValue(
    "PUSH_BUTTON1",
    ["foreCol", "text"],
    ["green", "red"]
    )
    .subscribe((success) => console.log(success));