Protected
_customOptional
unsubCommand: anyOptional
unsubParams: LooseObjectStart time of the interval from which alarms are returned
End time of the interval from which alarms are returned
Name(s) of the alert config(s) to return
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
Pattern to look up in CNS identifiers and IDs
If true, result will also include the Dps matching the returned CNS paths
An Observable. A subscription is necessary to send the message to the server.
oaRxJsApi.cnsGetCompletions('*Trend1', true,).subscribe((data) => console.log(data));
Opens a WebSock Object to the given baseUrl.
ConnectOptions
oaRxJsApi.connect("wss://localhost:8449/websocket ",
"YOUR_TOKEN",
{
baseParams: {
webViewId: 1
},
observer: {
next: (message) => {
console.log(message);
}
},
protocol: ['9b07f826-6a89-49fe-aed0-4af4dd8e9fbd', 'binary']
});
Optional
locale: stringSends a custom command to the WinCC OA wss server.
Command should be executed.
Parameter that are required for the costum command.
Optional
unsubCommand: stringA 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: LooseObjectParameter that are required for the unsubCommand.
Optional
options: CustomCommandOptionsAdditional options for the customCommand sent.
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')
Optional
unsubCommand: stringOptional
unsubParams: LooseObjectOptional
dataKey: stringOptional
id: string | numberOptional
shared: anyOptional
delay: anyOptional
processValues: anySends a custom command to the WinCC OA wss server.
Command should be executed.
Parameter that are required for the costum command.
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.
Parameter that are required for the unsubCommand.
A callback function that returns the ID used for the request.
Optional
options: Omit<CustomCommandOptions, "id">Additional options for the customCommand sent.
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));
Command that should be executed.
Parameter that are required for the custom command.
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.
Parameter that are required for the unsubCommand.
Optional
options: CustomCommandOptionsAdditional options for the customCommand sent.
An observable. A subscription is necessary to send the command to the server.
Calls a callback function whenever the passed data point values/attributes change.
Name of the Data Point Element
Specifies if the callback function should be executed the first time already when the dpConnect() is called or first every time a value changes
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.
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.
UUID of the corresponding connect request.
List of the DP names to add.
Object with addedCount and nonexistentDpNames
Removes one or more DPs from the subscription. DPs that are currently not included in the subscription are ignored.
UUID of the corresponding connect request.
List of the DP names to remove.
The number of DPs actually removed from the subscription.
Reads values of data point attributes
Name of the Data Point Element
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 data point elements
Name of the Data Point Element(s)
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
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 data point elements
Name of the Data Point Element(s)
Description mode (see WinCC OA Help for dpGetDescription()). Pass null to get default mode as specified by server
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 data point elements
Name of the Data Point Element(s)
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
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 data point elements
Name of the Data Point Element(s)
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 data point names or data point element names that match a pattern. The data point structures are written to the array in alphabetical order
Pattern
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.
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
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));
Assigns values to data point attributes
Name of the Data Point Element
New Value for the Data Point
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));
An Observable with the connection state of the api
Protected
getReads graphics attribute values for a graphics object in variables
Name of the graphics object
Names of the attributes
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));
Protected
processSet 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)
Name of the locale to use *
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
Name of the graphics object as it can be specified in the attribute editor. " " (empty string) addresses its own object
Name of the basic attribute
Parameters that describe the graphics attribute. The number of parameters depends on the graphics attribute
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));
Gets alarms inside a time interval