This is machine translation

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

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


Package: opc.hda

Read raw data stored over a time range from HDA server


DObj = readRaw(HdaClient,ItmList,StartTime,EndTime)
DObj = readRaw(HdaClient,ItmList,StartTime,EndTime,BoundsFlag)


DObj = readRaw(HdaClient,ItmList,StartTime,EndTime) reads data from the items defined by ItmList, stored on the OPC HDA server connected to OPC HDA Client HdaClient, between StartTime (inclusive) and EndTime (exclusive). The StartTime and EndTime arguments must be date numbers, or character vectors that can be converted to a MATLAB® date number. DObj is returned as an opc.hda.Data array, with one element per item specified in ItmList.

DObj = readRaw(HdaClient,ItmList,StartTime,EndTime,BoundsFlag) allows you to specify a bounds flag. If BoundsFlag is true, then the first data point on or outside the defined start and end times will be returned. If BoundsFlag is false, then only values that were time stamped between StartTime (inclusive) and EndTime (exclusive) will be included.

Note that one or more time stamps returned for each item may be unique to that item. To retrieve aligned data from an OPC HDA Server, use readAtTime or readProcessed.


Create an OPC HDA Client and connect the client to the server.

hdaObj = opchda('localhost','Matrikon.OPC.Simulation');

Read the last day’s data from two items.

DObj = readRaw(hdaObj, {'Random.Real8','Random.Real4'},now-1,now);

Introduced in R2011a

Was this topic helpful?