CVBpy 14.0
Server Class Reference

Represents an OPCUA server. More...

Inherits object.

Public Member Functions

int add_namespace (self, str name)
 Adds a new namespace defined as a string to the server. More...
 
None add_node (self, cvb.opcua.BaseNode node)
 Adds an OPCUA node to the server. More...
 
cvb.opcua.Server create (int port)
 Creates an OPCUA server with the specified port number. More...
 
None delete_node (self, cvb.opcua.NodeID node_id)
 Removes an OPCUA node from the OPCUA server. More...
 
Union[cvb.opcua.BaseNode, cvb.opcua.IntegerNode, cvb.opcua.StringNode, cvb.opcua.FloatNode, cvb.opcua.VariableNode, cvb.opcua.MethodNode, cvb.opcua.ObjectNodenode (self, cvb.opcua.NodeID node_id)
 Returns the node with the given node ID. More...
 
None start (self)
 Starts the OPCUA server.
 
None stop (self)
 Stops the OPCUA server.
 

Properties

 discoveryURL = property
 str: Gets the URL of an OPCUA server as string. More...
 

Detailed Description

Represents an OPCUA server.

It handles the server-side of the OPCUA client/server interaction. Unlike the cvb.opcua.Client, the server has start and stop operations. Primary tool for OPCUA modeling is the Server.add_node method. See also cvb.opcua.BaseNode for details.

Member Function Documentation

◆ add_namespace()

int add_namespace (   self,
str  name 
)

Adds a new namespace defined as a string to the server.

The namespace index of this namespace will be returned. The namespace index of the new assigned namespace is always assigned by the OPCUA server.

Parameters

name : str Name for the new namespace.

Returns

int The namespace index.

◆ add_node()

None add_node (   self,
cvb.opcua.BaseNode  node 
)

Adds an OPCUA node to the server.

See also cvb.opcua.BaseNode on node creation.

Parameters

node : cvb.opcua.BaseNode Node to be added.

◆ create()

cvb.opcua.Server create ( int  port)

Creates an OPCUA server with the specified port number.

The port must be a valid positive integer number. 4840 and 4843 are reserved for the OPCUA TCP protocol. They are usually used to connect to an LDS server. If you want to define a different number, please use a number in between 1024 and 65535 to avoid conflicting with well known ports, that are registered by the Internet Assigned Numbers Authority.

Parameters

port : int The port number.

Returns

cvb.opcua.Server The server object.

◆ delete_node()

None delete_node (   self,
cvb.opcua.NodeID  node_id 
)

Removes an OPCUA node from the OPCUA server.

Parameters

node_id : cvb.opcua.NodeID OPCUA node ID of the node to be removed form the server.

◆ node()

Returns the node with the given node ID.

Parameters

node_id : cvb.opcua.NodeID Node ID for the desired node.

Returns

Union[cvb.opcua.BaseNode, cvb.opcua.IntegerNode, cvb.opcua.StringNode, cvb.opcua.FloatNode, cvb.opcua.VariableNode, cvb.opcua.MethodNode, cvb.opcua.ObjectNode] The node object; the object type will be the specialized if possible.

Property Documentation

◆ discoveryURL

discoveryURL = property
static

str: Gets the URL of an OPCUA server as string.

The OPCUA server must be running on the URL being retrieved.