Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes | List of all members
opcua.common.node.Node Class Reference
Inheritance diagram for opcua.common.node.Node:
Inheritance graph
[legend]

Public Member Functions

def __eq__ (self, other)
 
def __hash__ (self)
 
def __init__ (self, server, nodeid)
 
def __ne__ (self, other)
 
def __str__ (self)
 
def add_data_type (self, nodeid, bname, description=None)
 
def add_folder (self, nodeid, bname)
 
def add_method (self, args)
 
def add_object (self, nodeid, bname, objecttype=None)
 
def add_object_type (self, nodeid, bname)
 
def add_property (self, nodeid, bname, val, varianttype=None, datatype=None)
 
def add_reference_type (self, parent, nodeid, bname)
 
def add_variable (self, nodeid, bname, val, varianttype=None, datatype=None)
 
def add_variable_type (self, nodeid, bname, datatype)
 
def call_method (self, methodid, args)
 
def delete (self, delete_references=True)
 
def get_access_level (self)
 
def get_array_dimensions (self)
 
def get_attribute (self, attr)
 
def get_attributes (self, attrs)
 
def get_browse_name (self)
 
def get_child (self, path)
 
def get_children (self, refs=ua.ObjectIds.HierarchicalReferences, nodeclassmask=ua.NodeClass.Unspecified)
 
def get_children_descriptions (self, refs=ua.ObjectIds.HierarchicalReferences, nodeclassmask=ua.NodeClass.Unspecified, includesubtypes=True)
 
def get_data_type (self)
 
def get_data_type_as_variant_type (self)
 
def get_data_value (self)
 
def get_description (self)
 
def get_display_name (self)
 
def get_event_notifier (self)
 
def get_methods (self)
 
def get_node_class (self)
 
def get_parent (self)
 
def get_path (self, max_length=20)
 
def get_path_as_string (self, max_length=20)
 
def get_properties (self)
 
def get_referenced_nodes (self, refs=ua.ObjectIds.References, direction=ua.BrowseDirection.Both, nodeclassmask=ua.NodeClass.Unspecified, includesubtypes=True)
 
def get_references (self, refs=ua.ObjectIds.References, direction=ua.BrowseDirection.Both, nodeclassmask=ua.NodeClass.Unspecified, includesubtypes=True)
 
def get_type_definition (self)
 
def get_user_access_level (self)
 
def get_value (self)
 
def get_value_rank (self)
 
def get_variables (self)
 
def history_read (self, details)
 
def history_read_events (self, details)
 
def read_event_history (self, starttime=None, endtime=None, numvalues=0, evtypes=ua.ObjectIds.BaseEventType)
 
def read_raw_history (self, starttime=None, endtime=None, numvalues=0)
 
def set_array_dimensions (self, value)
 
def set_attr_bit (self, attr, bit)
 
def set_attribute (self, attributeid, datavalue)
 
def set_event_notifier (self, values)
 
def set_read_only (self)
 
def set_value (self, value, varianttype=None)
 
def set_value_rank (self, value)
 
def set_writable (self, writable=True)
 
def unset_attr_bit (self, attr, bit)
 

Public Attributes

 nodeid
 
 server
 

Static Public Attributes

 set_data_value = set_value
 

Private Member Functions

def _get_path (self, max_length=20)
 
def _make_relative_path (self, path)
 

Static Private Attributes

 __repr__ = __str__
 

Detailed Description

High level node object, to access node attribute,
browse and populate address space.
Node objects are usefull as-is but they do not expose the entire
OPC-UA protocol. Feel free to look at the code of this class and call
directly UA services methods to optimize your code

Definition at line 10 of file node.py.

Constructor & Destructor Documentation

def opcua.common.node.Node.__init__ (   self,
  server,
  nodeid 
)

Definition at line 20 of file node.py.

Member Function Documentation

def opcua.common.node.Node.__eq__ (   self,
  other 
)

Definition at line 34 of file node.py.

def opcua.common.node.Node.__hash__ (   self)

Definition at line 46 of file node.py.

def opcua.common.node.Node.__ne__ (   self,
  other 
)

Definition at line 39 of file node.py.

def opcua.common.node.Node.__str__ (   self)

Definition at line 42 of file node.py.

def opcua.common.node.Node._get_path (   self,
  max_length = 20 
)
private
Attempt to find path of node from root node and return it as a list of Nodes.
There might several possible paths to a node, this function will return one
Some nodes may be missing references, so this method may
return an empty list
Since address space may have circular references, a max length is specified

Definition at line 384 of file node.py.

def opcua.common.node.Node._make_relative_path (   self,
  path 
)
private

Definition at line 439 of file node.py.

def opcua.common.node.Node.add_data_type (   self,
  nodeid,
  bname,
  description = None 
)

Definition at line 569 of file node.py.

def opcua.common.node.Node.add_folder (   self,
  nodeid,
  bname 
)

Definition at line 554 of file node.py.

def opcua.common.node.Node.add_method (   self,
  args 
)

Definition at line 575 of file node.py.

def opcua.common.node.Node.add_object (   self,
  nodeid,
  bname,
  objecttype = None 
)

Definition at line 557 of file node.py.

def opcua.common.node.Node.add_object_type (   self,
  nodeid,
  bname 
)

Definition at line 563 of file node.py.

def opcua.common.node.Node.add_property (   self,
  nodeid,
  bname,
  val,
  varianttype = None,
  datatype = None 
)

Definition at line 572 of file node.py.

def opcua.common.node.Node.add_reference_type (   self,
  parent,
  nodeid,
  bname 
)

Definition at line 578 of file node.py.

def opcua.common.node.Node.add_variable (   self,
  nodeid,
  bname,
  val,
  varianttype = None,
  datatype = None 
)

Definition at line 560 of file node.py.

def opcua.common.node.Node.add_variable_type (   self,
  nodeid,
  bname,
  datatype 
)

Definition at line 566 of file node.py.

def opcua.common.node.Node.call_method (   self,
  methodid,
  args 
)

Definition at line 581 of file node.py.

def opcua.common.node.Node.delete (   self,
  delete_references = True 
)
Delete node from address space

Definition at line 542 of file node.py.

def opcua.common.node.Node.get_access_level (   self)
Get the access level attribute of the node as a set of AccessLevel enum values.

Definition at line 80 of file node.py.

def opcua.common.node.Node.get_array_dimensions (   self)
Read and return ArrayDimensions attribute of node

Definition at line 148 of file node.py.

def opcua.common.node.Node.get_attribute (   self,
  attr 
)
Read one attribute of a node
result code from server is checked and an exception is raised in case of error

Definition at line 234 of file node.py.

def opcua.common.node.Node.get_attributes (   self,
  attrs 
)
Read several attributes of a node
list of DataValue is returned

Definition at line 248 of file node.py.

def opcua.common.node.Node.get_browse_name (   self)
Get browse name of a node. A browse name is a QualifiedName object
composed of a string(name) and a namespace index.

Definition at line 49 of file node.py.

def opcua.common.node.Node.get_child (   self,
  path 
)
get a child specified by its path from this node.
A path might be:
* a string representing a qualified name.
* a qualified name
* a list of string
* a list of qualified names

Definition at line 418 of file node.py.

def opcua.common.node.Node.get_children (   self,
  refs = ua.ObjectIds.HierarchicalReferences,
  nodeclassmask = ua.NodeClass.Unspecified 
)
Get all children of a node. By default hierarchical references and all node classes are returned.
Other reference types may be given:
References = 31
NonHierarchicalReferences = 32
HierarchicalReferences = 33
HasChild = 34
Organizes = 35
HasEventSource = 36
HasModellingRule = 37
HasEncoding = 38
HasDescription = 39
HasTypeDefinition = 40
GeneratesEvent = 41
Aggregates = 44
HasSubtype = 45
HasProperty = 46
HasComponent = 47
HasNotifier = 48
HasOrderedComponent = 49

Definition at line 263 of file node.py.

def opcua.common.node.Node.get_children_descriptions (   self,
  refs = ua.ObjectIds.HierarchicalReferences,
  nodeclassmask = ua.NodeClass.Unspecified,
  includesubtypes = True 
)

Definition at line 308 of file node.py.

def opcua.common.node.Node.get_data_type (   self)
get data type of node as NodeId

Definition at line 64 of file node.py.

def opcua.common.node.Node.get_data_type_as_variant_type (   self)
get data type of node as VariantType
This only works if node is a variable, otherwise type
may not be convertible to VariantType

Definition at line 71 of file node.py.

def opcua.common.node.Node.get_data_value (   self)
Get value of a node as a DataValue object. Only variables (and properties) have values.
An exception will be generated for other node types.
DataValue contain a variable value as a variant as well as server and source timestamps

Definition at line 132 of file node.py.

def opcua.common.node.Node.get_description (   self)
get description attribute class of node

Definition at line 117 of file node.py.

def opcua.common.node.Node.get_display_name (   self)
get description attribute of node

Definition at line 57 of file node.py.

def opcua.common.node.Node.get_event_notifier (   self)
Get the event notifier attribute of the node as a set of EventNotifier enum values.

Definition at line 94 of file node.py.

def opcua.common.node.Node.get_methods (   self)
return methods of node.
properties are child nodes with a reference of type HasComponent and a NodeClass of Method

Definition at line 301 of file node.py.

def opcua.common.node.Node.get_node_class (   self)
get node class attribute of node

Definition at line 110 of file node.py.

def opcua.common.node.Node.get_parent (   self)
returns parent of the node.
A Node may have several parents, the first found is returned.
This method uses reverse references, a node might be missing such a link,
thus we will not find its parent.

Definition at line 405 of file node.py.

def opcua.common.node.Node.get_path (   self,
  max_length = 20 
)
Attempt to find path of node from root node and return it as a list of Nodes.
There might several possible paths to a node, this function will return one
Some nodes may be missing references, so this method may
return an empty list
Since address space may have circular references, a max length is specified

Definition at line 370 of file node.py.

def opcua.common.node.Node.get_path_as_string (   self,
  max_length = 20 
)
Attempt to find path of node from root node and return it as a list of strings.
There might several possible paths to a node, this function will return one
Some nodes may be missing references, so this method may
return an empty list
Since address space may have circular references, a max length is specified

Definition at line 356 of file node.py.

def opcua.common.node.Node.get_properties (   self)
return properties of node.
properties are child nodes with a reference of type HasProperty and a NodeClass of Variable

Definition at line 287 of file node.py.

def opcua.common.node.Node.get_referenced_nodes (   self,
  refs = ua.ObjectIds.References,
  direction = ua.BrowseDirection.Both,
  nodeclassmask = ua.NodeClass.Unspecified,
  includesubtypes = True 
)
returns referenced nodes based on specific filter
Paramters are the same as for get_references

Definition at line 334 of file node.py.

def opcua.common.node.Node.get_references (   self,
  refs = ua.ObjectIds.References,
  direction = ua.BrowseDirection.Both,
  nodeclassmask = ua.NodeClass.Unspecified,
  includesubtypes = True 
)
returns references of the node based on specific filter defined with:

refs = ObjectId of the Reference
direction = Browse direction for references
nodeclassmask = filter nodes based on specific class
includesubtypes = If true subtypes of the reference (ref) are also included

Definition at line 311 of file node.py.

def opcua.common.node.Node.get_type_definition (   self)
returns type definition of the node.

Definition at line 347 of file node.py.

def opcua.common.node.Node.get_user_access_level (   self)
Get the user access level attribute of the node as a set of AccessLevel enum values.

Definition at line 87 of file node.py.

def opcua.common.node.Node.get_value (   self)
Get value of a node as a python type. Only variables ( and properties) have values.
An exception will be generated for other node types.

Definition at line 124 of file node.py.

def opcua.common.node.Node.get_value_rank (   self)
Read and return ArrayDimensions attribute of node

Definition at line 162 of file node.py.

def opcua.common.node.Node.get_variables (   self)
return variables of node.
properties are child nodes with a reference of type HasComponent and a NodeClass of Variable

Definition at line 294 of file node.py.

def opcua.common.node.Node.history_read (   self,
  details 
)
Read raw history of a node, low-level function
result code from server is checked and an exception is raised in case of error

Definition at line 475 of file node.py.

def opcua.common.node.Node.history_read_events (   self,
  details 
)
Read event history of a node, low-level function
result code from server is checked and an exception is raised in case of error

Definition at line 525 of file node.py.

def opcua.common.node.Node.read_event_history (   self,
  starttime = None,
  endtime = None,
  numvalues = 0,
  evtypes = ua.ObjectIds.BaseEventType 
)
Read event history of a source node
result code from server is checked and an exception is raised in case of error
If numvalues is > 0 and number of events in period is > numvalues
then result will be truncated

Definition at line 492 of file node.py.

def opcua.common.node.Node.read_raw_history (   self,
  starttime = None,
  endtime = None,
  numvalues = 0 
)
Read raw history of a node
result code from server is checked and an exception is raised in case of error
If numvalues is > 0 and number of events in period is > numvalues
then result will be truncated

Definition at line 453 of file node.py.

def opcua.common.node.Node.set_array_dimensions (   self,
  value 
)
Set attribute ArrayDimensions of node
make sure it has the correct data type

Definition at line 140 of file node.py.

def opcua.common.node.Node.set_attr_bit (   self,
  attr,
  bit 
)

Definition at line 202 of file node.py.

def opcua.common.node.Node.set_attribute (   self,
  attributeid,
  datavalue 
)
Set an attribute of a node
attributeid is a member of ua.AttributeIds
datavalue is a ua.DataValue object

Definition at line 219 of file node.py.

def opcua.common.node.Node.set_event_notifier (   self,
  values 
)
Set the event notifier attribute.

:param values: an iterable of EventNotifier enum values.

Definition at line 101 of file node.py.

def opcua.common.node.Node.set_read_only (   self)
Set a node as read-only for clients.
A node is always writable on server side.

Definition at line 212 of file node.py.

def opcua.common.node.Node.set_value (   self,
  value,
  varianttype = None 
)
Set value of a node. Only variables(properties) have values.
An exception will be generated for other node types.
value argument is either:
* a python built-in type, converted to opc-ua
optionnaly using the variantype argument.
* a ua.Variant, varianttype is then ignored
* a ua.DataValue, you then have full control over data send to server

Definition at line 169 of file node.py.

def opcua.common.node.Node.set_value_rank (   self,
  value 
)
Set attribute ArrayDimensions of node

Definition at line 155 of file node.py.

def opcua.common.node.Node.set_writable (   self,
  writable = True 
)
Set node as writable by clients.
A node is always writable on server side.

Definition at line 190 of file node.py.

def opcua.common.node.Node.unset_attr_bit (   self,
  attr,
  bit 
)

Definition at line 207 of file node.py.

Member Data Documentation

opcua.common.node.Node.__repr__ = __str__
staticprivate

Definition at line 44 of file node.py.

opcua.common.node.Node.nodeid

Definition at line 22 of file node.py.

opcua.common.node.Node.server

Definition at line 21 of file node.py.

opcua.common.node.Node.set_data_value = set_value
static

Definition at line 188 of file node.py.


The documentation for this class was generated from the following file:


ros_opcua_impl_python_opcua
Author(s): Denis Štogl , Daniel Draper
autogenerated on Tue Jan 19 2021 03:12:44