Hierarchy (view full)

Constructors

  • Parameters

    • sharedWorkerFactory: (() => SharedWorker)
        • (): SharedWorker
        • Returns SharedWorker

    Returns OaRxJsApi

Properties

emergencyMode$: Observable<EmergencyMode>

Methods

  • Type Parameters

    • T

    Parameters

    Returns Observable<T>

  • 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.

    Example

    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.

    Example

    oaRxJsApi.cnsGetCompletions('*Trend1', true,).subscribe((data) => console.log(data));
    
  • Opens a WebSock Object to the given baseUrl.

    Parameters

    • baseUrl: string | string[]
    • token: string
    • options: ConnectOptions

      ConnectOptions

      Example

       oaRxJsApi.connect("wss://localhost:8449/websocket ",
      "YOUR_TOKEN",
      {
      baseParams: {
      webViewId: 1
      },
      observer: {
      next: (message) => {
      console.log(message);
      }
      },
      protocol: ['9b07f826-6a89-49fe-aed0-4af4dd8e9fbd', 'binary']
      });
    • apiUrl: string = ''
    • Optional locale: string

    Returns Observable<ConnectData>

  • 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.

    • Optional 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.

    • Optional unsubParams: LooseObject

      Parameter that are required for the unsubCommand.

    • Optional options: CustomCommandOptions

      Additional options for the customCommand sent.

    Returns Observable<T>

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

    Example

    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
    • Optional unsubCommand: string
    • Optional unsubParams: LooseObject
    • Optional dataKey: string
    • Optional id: string | number
    • Optional shared: any
    • Optional delay: any
    • Optional processValues: 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) => void)

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

        • (uuid): void
        • Parameters

          • uuid: string

          Returns void

    • Optional options: 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.

    Example

    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.

    • Optional options: 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.

  • Closes the WebSock Object

    Parameters

    • disconnectAll: boolean = true

    Returns void

  • Calls a callback function whenever the passed data point 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.

    Example

    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.

    Example

    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<{
        addedCount: number;
        dpNameMap: {
            [dpNames: string]: string;
        };
        nonexistentDpNames: string[];
    }>

    Object with addedCount and nonexistentDpNames

  • 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: 1;
    }>

    The number of DPs actually removed from the subscription.

  • Reads values of data point 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.

    Example

    oaRxJsApi.dpGet('System1:_MemoryCheck.AvailKB:_original.._value').subscribe((data) => console.log(data));
    
  • Get aliases of data point 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.

    Example

    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.

    Example

    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 data point elements

    Parameters

    • dpName: string | string[]

      Name of the Data Point Element(s)

    • mode: number

      Description mode (see WinCC OA Help for dpGetDescription()). Pass null to get default mode as specified by server

    Returns Observable<DpGetDescriptionData>

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

    Example

    oaRxJsApi
    .dpGetDescription('Pump12.value.RotationSpeed', null)
    .subscribe((data) => console.log(data));
  • Get output format of data point 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.

    Example

    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.

    Example

    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 data point 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.

    Example

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

    Parameters

    • dpPattern: string

      Pattern

    • dpType: string

      Data point type. Allows to restrict the returned data points to a specific data point type. When using the parameter only data points that are matching the pattern and the selected data point 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

    Parameters

    • query: string

    Returns Observable<DpQueryData>

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

    Example

    oaRxJsApi
    .dpQuery("SELECT '_original.._value' FROM 'ExampleDP_Arg*' WHERE _DPT= \"ExampleDP_Float\"")
    .subscribe((data) => console.log(data));
  • Assigns values to data point 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.

    Example

    oaRxJsApi.dpSet('System1:_MemoryCheck.AvailKB:_original.._value', '1234').subscribe(success => console.log(success));
    
  • Returns Observable<WebSocketEvent>

    An Observable with the connection state of the api

  • Returns string

  • 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.

    Example

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

    //query multiple properties
    oaRxJsApi
    .getValue('PUSH_BUTTON1', ['foreCol', 'text'])
    .subscribe((data) => console.log(data));
  • Parameters

    • returnValue: any
    • dataKey: string = 'data'

    Returns any

  • Parameters

    Returns void

  • 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.

    Example

    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.

    Example

    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));