An OPCUA server object.
More...
#include <cvb/opcua/server.hpp>
Inherits enable_shared_from_this< Server >.
An OPCUA server object.
It handles the server side of the OPCUA client/server interaction.
- Note
- Unlike the OpcUa::Client, the server has start and stop operations.
-
Primary tool for OpcUa modeling is the OpcUa::Server::AddNode methods. See OpcUa::BaseNode for details.
-
for details also refer to the OPCUA specification Part 1:
https://opcfoundation.org/developer-tools/specifications-unified-architecture/part-1-overview-and-concepts/
◆ AddNameSpace()
Adds a new name space defined as a string to the server. The name space index of this name space will be returned.
- Note
- The namespace index of the new assigned namespace is always assigned by the OPCUA server.
- Parameters
-
[in] | name | New name of the namespace to be added to the server. |
- Returns
- Numeric index of new namespace name which is assigned by the OPCUA Server.
- Exceptions
-
◆ AddNode()
Adds a OPCUA node to the server.
- Note
- See OpcUa::BaseNode on node creation
- Parameters
-
[in] | node | The node to be added |
◆ Create()
Creates an OPCUA server with the specified port number.
- Parameters
-
[in] | 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 a LDS server If you want to define a different number, please use a number between 1024 and 65535 to avoid conflicts with well known ports, that are registered by the Internet Assigned Numbers Authority (IANA) |
- Returns
- Pointer of the OPCUA server object.
- Exceptions
-
- Examples
- OpcUa/BareboneServer, and OpcUa/ServerClientInteraction.
◆ DeleteNode()
void DeleteNode |
( |
const NodeID & |
id | ) |
|
|
inline |
Removes an OPCUA node from the OPCUA server.
- Parameters
-
[in] | id | OPCUA NodeID of the node to be removed form the server. |
- Exceptions
-
◆ DiscoveryURL()
Returns the URL of an OPCUA server as string.
- Note
- The OPCUA server must be running the retrieve the URL.
- Returns
- String representation of URL.
- Exceptions
-
◆ Handle()
Returns C-API style handle to the server.
- Returns
- C-API handle
◆ Node() [1/2]
Returns a node (typed). Valid types are BaseNode and all derivatives.
- Exceptions
-
◆ Node() [2/2]
Returns a node (without type).
- Note
- Please use this method only if you don't know the type of the node. Otherwise use Server::Node<Type>(...).
- Parameters
-
[in] | id | OPCUA NodeID identifing the requested node. |
- Exceptions
-
◆ Start()
Starts the OPCUA server.
- Exceptions
-
◆ Stop()
Stops the OPCUA server.
- Exceptions
-