uatools 1.0.0
 
Loading...
Searching...
No Matches
client.hpp File Reference

OPC UA client implementing ifw::fnd::defs::ICommAdapter. More...

#include <memory>
#include <ifw/fnd/defs/iCommAdapter.hpp>

Go to the source code of this file.

Classes

class  eso::uatools::Client
 OPC UA client implementing ifw::fnd::defs::ICommAdapter. More...
 
struct  eso::uatools::Client::DataTypeInfo
 Result of a DataType lookup on a node. More...
 

Namespaces

namespace  eso
 
namespace  eso::uatools
 

Detailed Description

OPC UA client implementing ifw::fnd::defs::ICommAdapter.

eso::uatools::Client is the public-facing class. It implements the protocol-agnostic ICommAdapter contract over OPC UA. The choice of open62541 as the underlying SDK is an implementation detail and is NOT exposed in this header — callers see only ifw::fnd::defs types.

Multiple instances are supported: typically one Client per OPC UA server connection. Instances do not share state with each other.

Usage:

using namespace ifw::fnd::defs;
ConnectionOptions opts;
opts.endpoint = "opc.tcp://plc-1.lan:4840";
opts.properties.Set("username", "operator");
opts.properties.Set("password", "******");
client.Configure(opts);
client.Connect();
ReadRequest req;
req.items.push_back({"ns=2;s=Temperature", {}});
ReadResult res = client.Read(req);
if (res) {
auto& dv = res.items.front().data.value();
double t = std::get<double>(dv.value);
}
OPC UA client implementing ifw::fnd::defs::ICommAdapter.
Definition client.hpp:57
ifw::fnd::defs::Result Configure(const ifw::fnd::defs::ConnectionOptions &options) override
Definition ualib.cpp:1479
ifw::fnd::defs::ReadResult Read(const ifw::fnd::defs::ReadRequest &request) override
Definition ualib.cpp:1771
ifw::fnd::defs::Result Connect() override
Definition ualib.cpp:1497
OPC UA client implementing ifw::fnd::defs::ICommAdapter.