QueryApplications is used to find Client or Server applications that meet the specified filters. The only Clients returned are those that support the reverse connection capability described in OPC 10000-6.

QueryApplications returns ApplicationDescriptions instead of the ServerOnNetwork Structures returned by QueryServers. This is more useful to some Clients because it matches the return type of FindServers.

Any Client is able to call this Method, however, the set of results returned may be restricted based on the Client’s user credentials.

The applications returned shall pass all of the filters provided (i.e. the filters are combined in an AND operation). The capabilities parameter is an array and an application will pass this filter if it supports all of the specified capabilities.

Each time the GDS creates or updates an application record it shall assign a monotonically increasing identifier to the record. This allows Clients to request records in batches by specifying the identifier for the last record received in the last call to QueryApplications. To support this the GDS shall return records in order starting from the lowest record identifier. The GDS shall also return the last time the counter was reset. If a Client detects that this time is more recent than the last time the Client called the Method it shall call the Method again with a startingRecordId of 0.

The lastCounterResetTime parameter is used to indicate that the counters on records had to be reset for some reason such as a Server restart. The Client may not use any nextRecordId received prior to this time to set the value for the startingRecordId in a new call.

The return parameter is a list of ApplicationDescriptions. The mapping from a ApplicationRecord to an ApplicationDescriptions is shown in Table 13.

Table 13 – ApplicationRecordDataType to ApplicationDescription Mapping

ApplicationRecordDataType

ApplicationDescription

Notes

applicationId

--

Ignored

applicationUri

applicationUri

applicationType

applicationType

applicationNames

applicationName

The name that best matches the preferredLocales for the current Session is returned. If there is no Session the first element is returned.

productUri

productUri

discoveryUrls

discoveryUrls

--

gatewayServerUri

Set to NULL.

--

discoveryProfileUri

Set to NULL.

serverCapabilities

--

Ignored

Signature

QueryApplications(

[in] UInt32 startingRecordId

[in] UInt32 maxRecordsToReturn

[in] String applicationName

[in] String applicationUri

[in] UInt32 applicationType

[in] String productUri

[in] String[] capabilities

[out] UtcTime lastCounterResetTime

[out] UInt32 nextRecordId

[out] ApplicationDescription[] applications

);

Argument

Description

INPUTS

startingRecordId

Only records with an identifier greater than this number will be returned.

Specify 0 to start with the first record in the database.

maxRecordsToReturn

The maximum number of records to return in the response.

0 indicates that there is no limit.

applicationName

The ApplicationName of the applications to return.

Supports the syntax used by the LIKE FilterOperator described in OPC 10000-4.

Not used if an empty string is specified.

The filter is only applied to the default ApplicationName.

applicationUri

The ApplicationUri of the applications to return.

Supports the syntax used by the LIKE FilterOperator described in OPC 10000-4.

Not used if an empty string is specified.

applicationType

A mask indicating what types of applications are returned.

The mask values are:

0x1 – Servers;

0x2 – Clients;

If the mask is 0 then all applications are returned.

productUri

The ProductUri of the applications to return.

Supports the syntax used by the LIKE FilterOperator described in OPC 10000-4.

Not used if an empty string is specified.

capabilities

The capabilities supported by the applications returned.

The applications returned shall support all of the capabilities specified. If no capabilities are provided this filter is not used.

The allowed values are defined in Annex D.

OUTPUTS

lastCounterResetTime

The last time the counters were reset.

nextRecordId

The identifier of the next record. It is passed as the startingRecordId in subsequent calls to QueryApplications to fetch the next batch of records. It is 0 if there are no more records to return.

applications

A list of Applications which meet the criteria.

The ApplicationDescription structure is defined in OPC 10000-4.

Table 14 specifies the AddressSpace representation for the QueryApplications Method.

Table 14 – QueryApplications Method AddressSpace Definition

Attribute

Value

BrowseName

2:QueryApplications

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

0:HasProperty

Variable

0:InputArguments

0:Argument[]

0:PropertyType

Mandatory

0:HasProperty

Variable

0:OutputArguments

0:Argument[]

0:PropertyType

Mandatory