High Performance OPC UA Server SDK  1.2.0.193
ua_readrawmodifieddetails Struct Reference

Selects a set of raw or modified values from the history database by specifying a time domain for one or more variables. More...

#include <readrawmodifieddetails.h>

Data Fields

bool is_read_modified
 TRUE for read modified functionality, FALSE for read raw functionality. More...
 
ua_datetime start_time
 The beginning of the period to read. More...
 
ua_datetime end_time
 The end of the period to read. More...
 
uint32_t num_values_per_node
 The maximum number of values returned for any node over the time range. More...
 
bool return_bounds
 A boolean parameter indicating whether bounding values should be returned. More...
 

Related Functions

void ua_readrawmodifieddetails_init (struct ua_readrawmodifieddetails *t)
 Initialize an ua_readrawmodifieddetails struct with a valid value. More...
 
void ua_readrawmodifieddetails_clear (struct ua_readrawmodifieddetails *t)
 Clear all resources alloctated in an ua_readrawmodifieddetails struct. More...
 
int ua_readrawmodifieddetails_compare (const struct ua_readrawmodifieddetails *a, const struct ua_readrawmodifieddetails *b)
 Compare two ua_readrawmodifieddetails structs. More...
 
int ua_readrawmodifieddetails_copy (struct ua_readrawmodifieddetails *dst, const struct ua_readrawmodifieddetails *src)
 Create a copy of a ua_readrawmodifieddetails struct. More...
 

Detailed Description

Selects a set of raw or modified values from the history database by specifying a time domain for one or more variables.

Read raw functionality

When this structure is used for reading Raw Values, it reads the values, qualities, and timestamps from the history database for the specified time domain for one or more HistoricalDataNodes. This parameter is intended for use by a Client that wants the actual data saved within the historian. The actual data may be compressed or may be all raw data collected for the item depending on the historian and the storage rules invoked when the item values were saved. When returnBounds is TRUE, the bounding values for the time domain are returned. The optional bounding values are provided to allow the Client to interpolate values for the start and end times when trending the actual data on a display.

The time domain of the request is defined by startTime, endTime, and numValuesPerNode; at least two of these must be specified. If endTime is less than startTime, or endTime and numValuesPerNode alone are specified, the data will be returned in reverse order, with later data coming first, as if time was flowing backward. If all three are specified, the call shall return up to numValuesPerNode results going from startTime to endTime, in either ascending or descending order, depending on the relative values of startTime and endTime. If numValuesPerNode is 0, all the values in the range are returned. A default value of DateTime.MinValue is used to indicate that startTime or endTime are not specified.

It is specifically allowed for the startTime and the endTime to be identical. This allows the Client to request just one value. If startTime and endTime are identical, time is presumed to be flowing forward. It is specifically not allowed for the server to return a Bad_InvalidArgument StatusCode if the requested time domain is outside of the server’s range. Such a case shall be treated as an interval in which no data exists.

If startTime, endTime, and numValuesPerNode are all provided and if more than numValuesPerNode values exist within that time range for a given node, only numValuesPerNode values per node are returned along with a continuationPoint. When a continuationPoint is returned, a Client wanting the next numValuesPerNode values should call ReadRaw again with the continuationPoint set.

If Bounding Values are requested and a non-zero numValuesPerNode was specified, any bounding values returned are included in the numValuesPerNode count. If numValuesPerNode is 1, only the start bound is returned (the end bound if reverse order is needed). If numValuesPerNode is 2, the start bound and the first data point are returned (the end bound if reverse order is needed). When bounding values are requested and no bounding value is found, the corresponding StatusCode entry will be set to Bad_BoundNotFound, a timestamp equal to the start or end time as appropriate, and a value of null. How far back or forward to look in history for bounding values is server dependent.

For an interval in which no data exists, if bounding values are not requested, the corresponding StatusCode must be Good_NoData. If bounding values are requested and one or both exist, then the result code returned is Success and the bounding value(s) are returned.

For cases where there are multiple values for a given timestamp, all but the most recent are considered to be modified values and the server must return the most recent value. If the server returns a value which hides other values at a timestamp, it must set the ExtraData bit in the StatusCode associated with that value. If the Server contains additional information regarding a value, the ExtraData bit shall also be set. This indicates that ModifiedValues are available for retrieval.

If the requested timestamp format is not supported for a node, the operation shall return the Bad_TimestampNotSupported StatusCode.

Read modified functionality

When this structure is used for reading modified values, it reads the values, StatusCodes, timestamps, modification type, the user identifier, and the timestamp of the modification from the history database for the specified time domain for one or more HistoricalDataNodes. If there are multiple replaced values, the server must return all of them. The updateType specifies which value is returned in the modification record. If the updateType is INSERT, the value is the new value that was inserted. If the updateType is anything else, the value is the old value that was changed.

The purpose of this function is to read values from history that have been modified. The returnBounds parameter must be set to FALSE for this case, otherwise the server returns a Bad_InvalidArgument StatusCode.

The domain of the request is defined by startTime, endTime, and numValuesPerNode; at least two of these must be specified. If endTime is less than startTime, or endTime and numValuesPerNode alone are specified, the data shall be returned in reverse order with later data coming first. If all three are specified, the call shall return up to numValuesPerNode results going from StartTime to EndTime, in either ascending or descending order, depending on the relative values of StartTime and EndTime. If more than numValuesPerNode values exist within that time range for a given Node, only numValuesPerNode values per node are returned along with a continuationPoint. If a continuationPoint is returned, a Client wanting the next numValuesPerNode values should call ReadRaw again with the continuationPoint set. If numValuesPerNode is 0, all of the values in the range are returned. If the Server cannot return all modified values for a given timestamp in a single response, it shall return modified values with the same timestamp in subsequent calls.

If a value has been modified multiple times, all values for the time are returned. This means that a timestamp can appear in the array more than once. The order of the returned values with the same timestamp should be from the most recent to oldest modification timestamp if startTime is less than or equal to endTime. If endTime is less than startTime, the order of the returned values will be from the oldest modificfication timestamp to the most recent. It is server dependent whether multiple modifications are kept or only the most recent.

A server does not have to create a modification record for data when it is first added to the historical collection. If it does, it shall set the ExtraData bit and the Client can read the modification record using a ReadModified call. If the data is subsequently modified, the server shall create a second modification record, which is returned along with the original modification record whenever a Client uses the ReadModified call if the Server supports multiple modification records per timestamp.

If the requested timestamp format is not supported for a Node, the operation shall return the Bad_TimestampNotSupported StatusCode.

Friends And Related Function Documentation

void ua_readrawmodifieddetails_clear ( struct ua_readrawmodifieddetails t)
related

Clear all resources alloctated in an ua_readrawmodifieddetails struct.

Frees allocated memory like arrays and resets numeric values. The ua_readrawmodifieddetails struct itself is not freed and must be freed by the caller if required. This function always succeeds for a valid ua_readrawmodifieddetails struct, that was validly decoded, initilized by ua_readrawmodifieddetails_init or created with ua_readrawmodifieddetails_copy.

int ua_readrawmodifieddetails_compare ( const struct ua_readrawmodifieddetails a,
const struct ua_readrawmodifieddetails b 
)
related

Compare two ua_readrawmodifieddetails structs.

Compares the content of the ua_readrawmodifieddetails struct a to the content of the ua_readrawmodifieddetails struct b. If a is smaller than b, an integer less than zero is returned, if a is bigger than b, an integer greater than zero is returned. If both structs are equal zero is returned.

This function creates a total order on ua_readrawmodifieddetails structs, so it is well suited to not only determine equality, but also sort multiple instances of this struct.

int ua_readrawmodifieddetails_copy ( struct ua_readrawmodifieddetails dst,
const struct ua_readrawmodifieddetails src 
)
related

Create a copy of a ua_readrawmodifieddetails struct.

Copy all fields from struct ua_readrawmodifieddetails src to dst. Creates a deep copy so all content is recusively copied and both src and dst can be used and must be freed separately.

dst is not cleared before the copy operation, so it must not have any allocated data. It may or may not be initilized by the caller before copy.

Returns
Zero on success or ua_statuscode on failure.
void ua_readrawmodifieddetails_init ( struct ua_readrawmodifieddetails t)
related

Initialize an ua_readrawmodifieddetails struct with a valid value.

After initialization the fields of the struct are set to valid and consistent values and can safley be accessed. An initialized ua_readrawmodifieddetails struct can also be passed to ua_readrawmodifieddetails_compare, ua_readrawmodifieddetails_copy and ua_readrawmodifieddetails_clear. This function will always succeed as long as an ua_readrawmodifieddetails struct is passed to it.

Field Documentation

end_time

The end of the period to read.

Set to default value of DateTime.MinValue if no specific end time is specified.

is_read_modified

TRUE for read modified functionality, FALSE for read raw functionality.

The default value is FALSE.

num_values_per_node

The maximum number of values returned for any node over the time range.

If only one time is specified, the time range must extend to return this number of values. The default value 0 indicates that there is no maximum.

return_bounds

A boolean parameter indicating whether bounding values should be returned.

It has the following values

TRUE
bounding values should be returned
FALSE
all other cases
start_time

The beginning of the period to read.

Set to default value of DateTime.MinValue if no specific start time is specified.


The documentation for this struct was generated from the following files: