High Performance OPC UA Server SDK
1.1.1.177
|
The details for insert, replace, and insert/replace history updates. More...
#include <updatedatadetails.h>
Data Fields | |
struct ua_nodeid | node_id |
Node ID of the object to be updated. | |
enum ua_performupdatetype | perform_insert_replace |
Determines which action of insert, replace, or update is performed. More... | |
struct ua_datavalue * | update_values |
New values to be inserted or to replace. | |
int32_t | num_update_values |
Number of elements in ua_updatedatadetails::update_values. | |
Related Functions | |
void | ua_updatedatadetails_init (struct ua_updatedatadetails *t) |
Initialize an ua_updatedatadetails struct with a valid value. More... | |
void | ua_updatedatadetails_clear (struct ua_updatedatadetails *t) |
Clear all resources alloctated in an ua_updatedatadetails struct. More... | |
int | ua_updatedatadetails_compare (const struct ua_updatedatadetails *a, const struct ua_updatedatadetails *b) |
Compare two ua_updatedatadetails structs. More... | |
int | ua_updatedatadetails_copy (struct ua_updatedatadetails *dst, const struct ua_updatedatadetails *src) |
Create a copy of a ua_updatedatadetails struct. More... | |
static int | ua_updatedatadetails_resize_update_values_array (struct ua_updatedatadetails *val, int32_t new_len) |
Resize the update_values array of a ua_updatedatadetails struct. More... | |
The details for insert, replace, and insert/replace history updates.
Insert data functionality
Setting performInsertReplace = INSERT_1 inserts entries into the history database at the specified timestamps for one or more HistoricalDataNodes. If an entry exists at the specified timestamp, the new entry shall not be inserted; instead the StatusCode shall indicate Bad_EntryExists.
This function is intended to insert new entries at the specified timestamps; e.g. the insertion of lab data to reflect the time of data collection.
Replace data functionality
Setting performInsertReplace = REPLACE_2 replaces entries in the history database at the specified timestamps for one or more HistoricalDataNodes. If no entry exists at the specified timestamp, the new entry shall not be inserted; otherwise the StatusCode shall indicate Bad_NoEntryExists.
This function is intended to replace existing entries at the specified timestamp; e.g., correct lab data that was improperly processed, but inserted into the history database.
Update data functionality
Setting performInsertReplace = UPDATE_3 inserts or replaces entries in the history database for the specified timestamps for one or more HistoricalDataNodes. If the item has an entry at the specified timestamp, the new entry will replace the old one. If there is no entry at that timestamp, the function will insert the new data.
A Server can create a modified value for a value being replaced or inserted, however it is not required.
This function is intended to unconditionally insert/replace values and qualities; e.g., correction of values for bad sensors.
Good as a StatusCode for an individual entry is allowed when the server is unable to say whether there was already a value at that timestamp. If the server can determine whether the new entry replaces an entry that was already there, it should use Good_EntryInserted or Good_EntryReplaced to return that information.
|
related |
Clear all resources alloctated in an ua_updatedatadetails struct.
Frees allocated memory like arrays and resets numeric values. The ua_updatedatadetails struct itself is not freed and must be freed by the caller if required. This function always succeeds for a valid ua_updatedatadetails struct, that was validly decoded, initilized by ua_updatedatadetails_init or created with ua_updatedatadetails_copy.
|
related |
Compare two ua_updatedatadetails structs.
Compares the content of the ua_updatedatadetails struct a
to the content of the ua_updatedatadetails 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_updatedatadetails structs, so it is well suited to not only determine equality, but also sort multiple instances of this struct.
|
related |
Create a copy of a ua_updatedatadetails struct.
Copy all fields from struct ua_updatedatadetails 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.
|
related |
Initialize an ua_updatedatadetails 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_updatedatadetails struct can also be passed to ua_updatedatadetails_compare, ua_updatedatadetails_copy and ua_updatedatadetails_clear. This function will always succeed as long as an ua_updatedatadetails struct is passed to it.
|
related |
Resize the update_values array of a ua_updatedatadetails 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.
new_len | New length of the update_values array in number of members. |
perform_insert_replace |
Determines which action of insert, replace, or update is performed.
Possible values are INSERT_1, REPLACE_2, or UPDATE_3, see ua_updatedatadetails