High Performance OPC UA Server SDK  1.4.1.263
ua_readrequest Struct Reference

Reads values and attributes asynchronously from OPC server. More...

#include <readrequest.h>

Data Fields

double max_age
 Maximum age of the value to be read in milliseconds. More...
 
enum ua_timestampstoreturn ts
 An enumeration that specifies the Timestamps to be returned for each requested Variable Value Attribute. More...
 
struct ua_readvalueidnodes
 List of Nodes and their Attributes to read. More...
 
int32_t num_nodes
 Number of elements in ua_readrequest::nodes.
 

Related Functions

void ua_readrequest_init (struct ua_readrequest *t)
 Initialize an ua_readrequest struct with a valid value. More...
 
void ua_readrequest_clear (struct ua_readrequest *t)
 Clear all resources alloctated in an ua_readrequest struct. More...
 
int ua_readrequest_compare (const struct ua_readrequest *a, const struct ua_readrequest *b)
 Compare two ua_readrequest structs. More...
 
int ua_readrequest_copy (struct ua_readrequest *dst, const struct ua_readrequest *src)
 Create a copy of a ua_readrequest struct. More...
 
static int ua_readrequest_resize_nodes_array (struct ua_readrequest *val, int32_t new_len)
 Resize the NodesToRead array of a ua_readrequest struct. More...
 

Detailed Description

Reads values and attributes asynchronously from OPC server.

The Read Service is used to read one or more attributes of one or more nodes. It allows also reading subsets or single elements of array values and to define a valid age of values to be returned to reduce the need for device reads. Like most other services, the read is optimized for bulk read operations and not for reading single Attribute values. Typically all Node Attributes are readable. For the Value Attribute the Read rights are indicated by the AccessLevel and UserAccessLevel Attribute of the Variable.

Friends And Related Function Documentation

◆ ua_readrequest_clear()

void ua_readrequest_clear ( struct ua_readrequest t)
related

Clear all resources alloctated in an ua_readrequest struct.

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

◆ ua_readrequest_compare()

int ua_readrequest_compare ( const struct ua_readrequest a,
const struct ua_readrequest b 
)
related

Compare two ua_readrequest structs.

Compares the content of the ua_readrequest struct a to the content of the ua_readrequest 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_readrequest structs, so it is well suited to not only determine equality, but also sort multiple instances of this struct.

◆ ua_readrequest_copy()

int ua_readrequest_copy ( struct ua_readrequest dst,
const struct ua_readrequest src 
)
related

Create a copy of a ua_readrequest struct.

Copy all fields from struct ua_readrequest 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.

◆ ua_readrequest_init()

void ua_readrequest_init ( struct ua_readrequest t)
related

Initialize an ua_readrequest 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_readrequest struct can also be passed to ua_readrequest_clear. This function will always succeed as long as an ua_readrequest struct is passed to it.

◆ ua_readrequest_resize_nodes_array()

static int ua_readrequest_resize_nodes_array ( struct ua_readrequest val,
int32_t  new_len 
)
related

Resize the NodesToRead array of a ua_readrequest struct.

Depending on new_len and the current size of the array, the array will be created, increased, decreased or deleted. In case array members are removed these are cleared properly, new array members are initialized with zero.

Parameters
valThe value to be resized.
new_lenNew length of the NodesToRead array in number of members.
Returns
Zero on success or ua_statuscode on failure.

Field Documentation

◆ max_age

max_age

Maximum age of the value to be read in milliseconds.

The age of the value is based on the difference between the ServerTimestamp and the time when the Server starts processing the request. For example if the Client specifies a maxAge of 500 milliseconds and it takes 100 milliseconds until the Server starts processing the request, the age of the returned value could be 600 milliseconds prior to the time it was requested.

If the Server has one or more values of an Attribute that are within the maximum age, it can return any one of the values or it can read a new value from the data source. The number of values of an Attribute that a Server has depends on the number of MonitoredItems that are defined for the Attribute. In any case, the Client can make no assumption about which copy of the data will be returned.

If the Server does not have a value that is within the maximum age, it shall attempt to read a new value from the data source.

If the Server cannot meet the requested maxAge, it returns its "best effort" value rather than rejecting the request. This may occur when the time it takes the Server to process and return the new data value after it has been accessed is greater than the specified maximum age.

If maxAge is set to 0, the Server shall attempt to read a new value from the data source.

If maxAge is set to the max Int32 value or greater, the Server shall attempt to get a cached value.

Negative values are invalid for maxAge.

◆ nodes

nodes

List of Nodes and their Attributes to read.

For each entry in this list, a StatusCode is returned, and if it indicates success, the Attribute Value is also returned.

◆ ts

ts

An enumeration that specifies the Timestamps to be returned for each requested Variable Value Attribute.

See ua_timestampstoreturn for more information.


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