read historical data over a time range
the function allows you to request the value, quality, and timestamp data for a list of items over a specified time domain. define the time domain by indicating start and end times for the sampling. this function returns all data stored on the historian within the given time range.
by default, historians return the first data point found from
the start time specified, up to the data point found just before the
end time. by setting the optional 'bounds'
parameter
to true
, you can indicate that bounding values
be included. the server then returns data at the start and end times.
if no data exists at those exact times, the server returns the data
value that is closest to that time but outside the time range specified.
this function is useful if you want to retrieve raw values from the server, and processes that data using matlab® rather than relying on the server to perform the processing for you.
for example, if you are interested in the values between 17
november 2010 and 18 november 2010 in the 'int2'
items
under the 'random'
branch of an opc hda server,
and you were interested in retrieving the bounding values, use this
code:
dataobject = readraw(hdaclient, 'random.int2', ... datenum(2010,11,17), datenum(2010,11,18), true)
to read values at specified time stamps use the function. if you are reading large amounts of data and will be aggregating that data, consider using (if your server supports that function).