High Performance OPC UA Server SDK
1.7.1.383
|
Access for nodeclass variable specific attributes. More...
Functions | |
SERVER_EXPORT int | ua_variable_set_datatype (ua_node_t node, struct ua_nodeid *datatype) |
Set the datatype attribute of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_builtindatatype (ua_node_t node, enum ua_variant_type type) |
Set the datatype attribute of a variable node to a builtin variant type. More... | |
SERVER_EXPORT int | ua_variable_get_datatype (ua_node_t node, struct ua_nodeid *datatype) |
Get the datatype attribute of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_access_level (ua_node_t node, uint8_t accesslevel) |
Set the accesslevel attribute of a variable node. More... | |
SERVER_EXPORT uint8_t | ua_variable_get_access_level (ua_node_t node) |
Get the accesslevel attribute of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_historizing (ua_node_t node, bool historizing) |
Set the historizing attribute of a variable node. More... | |
SERVER_EXPORT bool | ua_variable_get_historizing (ua_node_t node) |
Get the historizing attribute of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_valuerank (ua_node_t node, int32_t valuerank) |
Set the valuerank attribute of a variable node. More... | |
SERVER_EXPORT int32_t | ua_variable_get_valuerank (ua_node_t node) |
Get the valuerank attribute of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_arraydimensions (ua_node_t node, int32_t num_dimensions, uint32_t *dimensions) |
Sets or updates array dimensions of a variable. More... | |
SERVER_EXPORT int | ua_variable_get_arraydimensions (ua_node_t node, int32_t *num_dimensions, uint32_t *dimensions) |
Returns the array dimensions for the given variable. More... | |
SERVER_EXPORT int | ua_variable_set_minimum_sampling_interval (ua_node_t node, uint32_t minimum_sampling_interval) |
Set the minimum samplinginterval attribute of a variable node. More... | |
SERVER_EXPORT uint32_t | ua_variable_get_minimum_sampling_interval (ua_node_t node) |
Get the minimum samplinginterval attribute of a variable node. More... | |
SERVER_EXPORT double | ua_variable_get_minimum_sampling_interval_dbl (ua_node_t node) |
Get the minimum samplinginterval attribute of a variable node as double. More... | |
SERVER_EXPORT int | ua_variable_set_store_index (ua_node_t node, uint8_t storeindex) |
Set the store index of a variable node. More... | |
SERVER_EXPORT int | ua_variable_get_store_index (ua_node_t node, uint8_t *storeindex) |
Get the store index of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_value_index (ua_node_t node, unsigned int valueindex) |
Set the valueindex of a variable node. More... | |
SERVER_EXPORT int | ua_variable_get_value_index (ua_node_t node, unsigned int *valueindex) |
Get the valueindex of a variable node. More... | |
SERVER_EXPORT int | ua_variable_set_attributes (ua_node_t node, struct ua_nodeid *datatype_id, int32_t valuerank, uint8_t access_level, bool historizing) |
Set the mandatory attributes of a variable node. More... | |
SERVER_EXPORT int | ua_variable_copy (ua_node_t dst, ua_node_t src) |
Copy the attributes specific to nodelcass variable from the node src to dst . More... | |
SERVER_EXPORT int | ua_variable_get_access_level_store_value_index (ua_node_t node, uint8_t *accesslevel, uint8_t *storeindex, unsigned int *valueindex) |
Combines the functionality of ua_variable_get_access_level, ua_variable_get_store_index and ua_variable_get_value_index. More... | |
SERVER_EXPORT int | ua_variable_get_access_level_address (ua_node_t node, uint8_t *accesslevel, struct ua_valuestore_address_info *address) |
Returns the accesslevel and value store address for the given node. More... | |
SERVER_EXPORT int | ua_variable_set_value (ua_node_t node, struct ua_variant *val, ua_statuscode *presult) |
Convenience function for setting a new value for the given variable. More... | |
SERVER_EXPORT int | ua_variable_get_value (ua_node_t node, struct ua_variant *val) |
Convenience function for reading the current value of the given variable. More... | |
Access for nodeclass variable specific attributes.
Copy the attributes specific to nodelcass variable from the node src
to dst
.
If the value is readonly the valueindex and storeindex are copied, so the src and dst nodes point to the same value, for writeable values no valueindex and storeindex is set. The arraydimension are also not copied as these are not completely implemented yet.
SERVER_EXPORT uint8_t ua_variable_get_access_level | ( | ua_node_t | node | ) |
Get the accesslevel attribute of a variable node.
node | Handle of node to get the accesslevel. |
SERVER_EXPORT int ua_variable_get_access_level_address | ( | ua_node_t | node, |
uint8_t * | accesslevel, | ||
struct ua_valuestore_address_info * | address | ||
) |
Returns the accesslevel and value store address for the given node.
This supersedes ua_variable_get_access_level_store_value_index.
node | Node of class variable to get the attributes. |
accesslevel | Pointer to value where the access level is written to. |
address | Pointer to address info struct which receive the value address information. |
SERVER_EXPORT int ua_variable_get_access_level_store_value_index | ( | ua_node_t | node, |
uint8_t * | accesslevel, | ||
uint8_t * | storeindex, | ||
unsigned int * | valueindex | ||
) |
Combines the functionality of ua_variable_get_access_level, ua_variable_get_store_index and ua_variable_get_value_index.
This information is often needed at once and it is much more efficient to get it at once, so this function is a pure performance optimization.
node | Node of class variable to get the attributes. |
accesslevel | Pointer to value where the access level is written to. |
storeindex | Pointer to value where the store index is written to. |
valueindex | Pointer to value where the value index is written to. |
SERVER_EXPORT int ua_variable_get_arraydimensions | ( | ua_node_t | node, |
int32_t * | num_dimensions, | ||
uint32_t * | dimensions | ||
) |
Returns the array dimensions for the given variable.
node
must reference a variable nodeclass otherwise the function will return UA_EBADINVALIDARGUMENT. The dimension
parameter is optional, if dimensions
is NULL only the length of arraydimensions array will be returned.
node | Node handle which identifies the variable. |
num_dimensions | Pointer to length field. When calling the function *num_dimensions should be the (maximum) length of the dimensions array. When the function returns this will contain the number of used elements. |
dimensions | Pointer to preallocated dimensions array. May be NULL if only num_dimensions should be read. |
Get the datatype attribute of a variable node.
node | Handle of node to get datatype. |
datatype | Nodeid representing the datatype of the node. |
SERVER_EXPORT bool ua_variable_get_historizing | ( | ua_node_t | node | ) |
Get the historizing attribute of a variable node.
node | Handle of node to get the historizing attribute. |
SERVER_EXPORT uint32_t ua_variable_get_minimum_sampling_interval | ( | ua_node_t | node | ) |
Get the minimum samplinginterval attribute of a variable node.
node | Handle of node to get the the attribute. |
SERVER_EXPORT double ua_variable_get_minimum_sampling_interval_dbl | ( | ua_node_t | node | ) |
Get the minimum samplinginterval attribute of a variable node as double.
node | Handle of node to get the the attribute. |
SERVER_EXPORT int ua_variable_get_store_index | ( | ua_node_t | node, |
uint8_t * | storeindex | ||
) |
Get the store index of a variable node.
node | Handle of node to get store index. |
storeindex | Pointer to value where the store index is written to. |
SERVER_EXPORT int ua_variable_get_value | ( | ua_node_t | node, |
struct ua_variant * | val | ||
) |
Convenience function for reading the current value of the given variable.
This function gets store interface associated with the variable and calls the get function to get the variable's value from the configured store.
This only works for variables with an associated store.
This function is useful for retrieving single values for internal logic. For implementing the read service in a provider the function uaserver_read_internal is more appropriate.
node | Variable handle. |
val | Returns the read variant value. The returned value must be cleared using ua_variant_clear. If the operation fails the return value is undefined. |
SERVER_EXPORT int ua_variable_get_value_index | ( | ua_node_t | node, |
unsigned int * | valueindex | ||
) |
Get the valueindex of a variable node.
node | Handle of node to get valueindex. |
valueindex | Pointer to value where the valueindex is written to. |
SERVER_EXPORT int32_t ua_variable_get_valuerank | ( | ua_node_t | node | ) |
Get the valuerank attribute of a variable node.
node | Handle of node to get the valuerank |
SERVER_EXPORT int ua_variable_set_access_level | ( | ua_node_t | node, |
uint8_t | accesslevel | ||
) |
Set the accesslevel attribute of a variable node.
node | Handle of node to set accesslevel. |
accesslevel | Accesslevel to set. Multiple accesslevels can be combined with the bitwise OR operator. |
SERVER_EXPORT int ua_variable_set_arraydimensions | ( | ua_node_t | node, |
int32_t | num_dimensions, | ||
uint32_t * | dimensions | ||
) |
Sets or updates array dimensions of a variable.
This allocates a dimension object internal to store this information, if it does not exist already. To free these resources you can call this operation with num_dimensions=0 and dimensions=NULL, or just delete the node using ua_node_delete.
node | Handle of the variable node. |
num_dimensions | Number of dimensions which is the array length of dimensions . |
dimensions | Array with the length for each dimension. |
Even though it is allowed to set dimension info like {0} for unknown size it is recommended to not set this information, because this wastes memory.
SERVER_EXPORT int ua_variable_set_attributes | ( | ua_node_t | node, |
struct ua_nodeid * | datatype_id, | ||
int32_t | valuerank, | ||
uint8_t | access_level, | ||
bool | historizing | ||
) |
Set the mandatory attributes of a variable node.
node | Node of class variable to set the attributes. |
datatype_id | Nodeid of the datatype of the variable node. |
valuerank | Valuerank of the variable node. |
access_level | Accesslevel of the variable node. |
historizing | True if the variable supports history access. |
SERVER_EXPORT int ua_variable_set_builtindatatype | ( | ua_node_t | node, |
enum ua_variant_type | type | ||
) |
Set the datatype attribute of a variable node to a builtin variant type.
node | Handle of node to set the datatype. |
type | Variant type to set as datatype. |
Set the datatype attribute of a variable node.
node | Handle of node to set the datatype. |
datatype | Nodeid to set as datatype. The node must exist in the server addressspace. |
SERVER_EXPORT int ua_variable_set_historizing | ( | ua_node_t | node, |
bool | historizing | ||
) |
Set the historizing attribute of a variable node.
node | Handle of node to set historizing attribute. |
historizing | True if historizing is enabled for the node, false otherwise. |
SERVER_EXPORT int ua_variable_set_minimum_sampling_interval | ( | ua_node_t | node, |
uint32_t | minimum_sampling_interval | ||
) |
Set the minimum samplinginterval attribute of a variable node.
node | Handle of node to set the the attribute. |
minimum_sampling_interval | Minimum samplinginterval to set. |
SERVER_EXPORT int ua_variable_set_store_index | ( | ua_node_t | node, |
uint8_t | storeindex | ||
) |
Set the store index of a variable node.
The storeindex may only be set values for which a store was registered with ua_valuestore_register_store.
node | Handle of node to set store index. |
storeindex | Store index to set. |
SERVER_EXPORT int ua_variable_set_value | ( | ua_node_t | node, |
struct ua_variant * | val, | ||
ua_statuscode * | presult | ||
) |
Convenience function for setting a new value for the given variable.
This function gets store interface associated with the variable and calls the attach function to store the variable's value in the configured store.
This only works for variables with an associated store.
This function is useful for setting single values for internal logic. For implementing the write service in a provider the function uaserver_write_internal is more appropriate.
node | Variable handle. |
val | Variant value to set. Note that this value gets attached and must not be freed by the caller. The variant argument to it initialized state, so that any variant_clear call afterwards becomes a NOP. Even if the operation fails to attach the value the variant gets cleared properly, so the caller can simply forget the variant and doesn't need to implement any cleanup for it. |
presult | Returns the store write result. This is only valid if zero is returned as function result. The argument may be NULL if not needed. A possible error might be UA_SCBADTYPEMISMATCH. |
SERVER_EXPORT int ua_variable_set_value_index | ( | ua_node_t | node, |
unsigned int | valueindex | ||
) |
Set the valueindex of a variable node.
The valueindex may be used in combination with a valuestore or freely by the user for an arbitrary index
node | Handle of node to set valueindex. |
valueindex | Value for the valueindex. |
SERVER_EXPORT int ua_variable_set_valuerank | ( | ua_node_t | node, |
int32_t | valuerank | ||
) |
Set the valuerank attribute of a variable node.
node | Handle of node to set the valuerank |
valuerank | Valuerank to set. Possible values are:
|