#include <iostream>
int main() {
{1, "TheAnswer"},
"The Answer",
.setDescription({"en-US", "Answer to the Ultimate Question of Life"})
.setDataType<int>()
);
std::cout <<
"The answer is: " << myIntegerNode.
readValueScalar<
int>() << std::endl;
}
High-level node class to access node attribute, browse and populate address space.
Node & writeValueScalar(const T &value)
Write scalar to variable node.
T readValueScalar()
Read scalar value from variable node.
Node addVariable(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add variable.
void setApplicationName(std::string_view name)
Set application name, default: open62541-based OPC UA Application.
void setProductUri(std::string_view uri)
Set product URI, default: http://open62541.org.
void run()
Run the server's main loop. This method will block until Server::stop is called.
void setApplicationUri(std::string_view uri)
Set application URI, default: urn:open62541.server.application.
UA_VariableAttributes wrapper class.
auto & setDisplayName(const LocalizedText &displayName)