Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Static Private Attributes
opcua.common.node.Node Class Reference

List of all members.

Public Member Functions

def __eq__
def __hash__
def __init__
def __ne__
def __str__
def add_data_type
def add_folder
def add_method
def add_object
def add_object_type
def add_property
def add_reference_type
def add_variable
def add_variable_type
def call_method
def delete
def get_access_level
def get_array_dimensions
def get_attribute
def get_attributes
def get_browse_name
def get_child
def get_children
def get_children_descriptions
def get_data_type
def get_data_type_as_variant_type
def get_data_value
def get_description
def get_display_name
def get_event_notifier
def get_methods
def get_node_class
def get_parent
def get_path
def get_path_as_string
def get_properties
def get_referenced_nodes
def get_references
def get_type_definition
def get_user_access_level
def get_value
def get_value_rank
def get_variables
def history_read
def history_read_events
def read_event_history
def read_raw_history
def set_array_dimensions
def set_attr_bit
def set_attribute
def set_event_notifier
def set_read_only
def set_value
def set_value_rank
def set_writable
def unset_attr_bit

Public Attributes

 nodeid
 server

Static Public Attributes

 set_data_value = set_value

Private Member Functions

def _get_path
def _make_relative_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.

Definition at line 46 of file node.py.

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

Definition at line 39 of file node.py.

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.

Get the access level attribute of the node as a set of AccessLevel enum values.

Definition at line 80 of file node.py.

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.

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.

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.

get data type of node as NodeId

Definition at line 64 of file node.py.

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.

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.

get description attribute class of node

Definition at line 117 of file node.py.

get description attribute of node

Definition at line 57 of file node.py.

Get the event notifier attribute of the node as a set of EventNotifier enum values.

Definition at line 94 of file node.py.

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.

get node class attribute of node

Definition at line 110 of file node.py.

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.

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.

returns type definition of the node.

Definition at line 347 of file node.py.

Get the user access level attribute of the node as a set of AccessLevel enum values.

Definition at line 87 of file node.py.

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.

Read and return ArrayDimensions attribute of node

Definition at line 162 of file node.py.

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.

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

Definition at line 44 of file node.py.

Definition at line 20 of file node.py.

Definition at line 20 of file node.py.

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 Sat Jun 8 2019 18:26:24