open62541pp 0.16.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
client_minimal.cpp
#include <iostream>
int main() {
opcua::Client client;
client.connect("opc.tcp://localhost:4840");
const auto dt = node.readValueScalar<opcua::DateTime>();
std::cout << "Server date (UTC): " << dt.format("%Y-%m-%d %H:%M:%S") << std::endl;
}
High-level client class.
Definition client.hpp:121
void connect(std::string_view endpointUrl)
Connect to the selected server.
UA_DateTime wrapper class.
Definition types.hpp:354
std::string format(std::string_view format, bool localtime=false) const
Convert to string with given format (same format codes as strftime).
High-level node class to access node attribute, browse and populate address space.
Definition server.hpp:30
T readValueScalar()
Read scalar value from variable node.
Definition node.hpp:850