Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

opchda

Create OPC historical data access client

Syntax

  • hdaObj = opchda(SIObj)
    example
  • hdaObj = opchda(Hostname,ServerID)
    example
  • hdaObj = opchda(Hostname,ServerID,Name,Value)
  • hdaObj = opchda(SIObj,Name,Value)

Description

example

hdaObj = opchda(SIObj) constructs an OPC HDA client object, hdaObj, for the information provided in the OPC HDA ServerInfo object, SIObj, obtained from an opchdaserverinfo function call.

example

hdaObj = opchda(Hostname,ServerID) constructs hdaObj for the host specified by Hostname and the OPC server ID specified by ServerID.

When you construct hdaObj, its initial Status property value is 'disconnected'. To communicate with the server, connect hdaObj to the server using the connect function.

hdaObj = opchda(Hostname,ServerID,Name,Value) applies the specified property values to the client created with the Host and ServerID parameters. If you specify an invalid property name or value, the function does not create an object.

hdaObj = opchda(SIObj,Name,Value) applies the specified property values to the client created with the ServerInfo object, SIObj. If you specify an invalid property name or value, the function does not create an object.

Examples

collapse all

Create an OPC HDA client object for a specific client on the local host.

hdaObj = opchda('localhost','MyHDAServer.1');

Create OPC HDA client objects for all clients on the local host.

SIObj  = opchdaserverinfo('localhost');
hdaObj = opchda(SIObj);

Input Arguments

collapse all

OPC HDA server information, specified as an OPC HDA ServerInfo object. This object is returned from the function opchdaserverinfo.

Example: SIOjb = opchdaserverinfo

OPC HDA server host name specified as a character vector.

Example: 'host-name'

Data Types: char

Identifier of OPC HDA server, specified as a character vector.

Example: 'MyHDAServer.1'

Data Types: char

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'Timeout',60

The argument name identifies a property of the created OPC HDA client object. Note that the name-value pairs can be any format that the set function supports, i.e., name-value pairs, structures, and name-value cell array pairs.

collapse all

Maximum time to wait for completion of instruction to server, specified in seconds.

Example:

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Data to associate with object, specified as any MATLAB data type. UserData stores any data that you want to associate with the object. The object does not use this data directly, but you can use the data for identification or other purposes.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | struct | cell

Output Arguments

collapse all

OPC HDA client, returned as an OPC HDA client object.

Introduced in R2013a

Was this topic helpful?