onewayautomation / ogamma-sdk Goto Github PK
View Code? Open in Web Editor NEWC++ OPC UA SDK from One-Way Automation - public redistributables
C++ OPC UA SDK from One-Way Automation - public redistributables
Hello,
currently I am reading all of my Nodes (around 40) in a while-loop and appending them to a buffer when read.
But I experienced a decreased sample rate when adding nodes to my reading-loop.
e.g.: 1 Node to read -> Sample rate = 200Hz (adding 200 values to my buffer per second).
4 Nodes to read -> Sample rate = 40Hz
Also I thought about just reading/storing node-values as soon as the value changed.
Looking through your code I think this should be possible, but I couldn't manage to make it run - Could you maybe provide me a short example of how to use the notification on value change?
Thanks in advance!
Hello,
I am currently trying to connect to two different OPC-UA Servers with your SDK and "Hello World" example.
For the first one it works totally fine and I can access and read all nodes.
With the second one I am encountering a connection problem where I receive the wrong endpoint from the server. Connecting to this particular server works fine with UaExpert (it somehow ignores the wrong returned endpoint-url).
This is the Code I am using:
#include <opcua/Connection.h>
#include <iostream>
#include <conio.h>
using namespace std;
using namespace OWA::OpcUa;
int main (int argc, char** argv)
{
(void)argc;
(void)argv;
bool succeeded = false;
{
auto connection = Connection::create("opc.tcp://128.130.57.75:4840", true);
if (connection->connect().get().isGood())
{
cout << "Connection established" << endl;
NodeId nodeId("NS1|String|DISPLAY_CURRENT", 1);
nodeId.setStringIdentifier("DISPLAY_CURRENT", 1);
for (int i = 0; i < 100; i++) {
ReadRequest::Ptr readRequest(new ReadRequest(nodeId));
auto readResponse = connection->send(readRequest).get();
if (readResponse->isGood() && readResponse->results.size() == 1 && Utils::isGood(readResponse->results[0].statusCode))
{
cout << "READREQUEST # " << i << endl;
// We know that data type of the value is String, therefore convert it to string should succeed:
float currentValue = readResponse->results[0].value;
DateTime tstamp = readResponse->results[0].sourceTimestamp;
//string newValue = (currentValue == value1) ? value2 : value1;
cout << "DISPLAY_CURRENT: " << currentValue << endl;
const string abc;
cout << "TSTAMP: " << tstamp.toString() << endl;
succeeded = true;
}
}
_getch();
}
}
OWA::OpcUa::Utils::closeSdk();
if (!succeeded)
{
std::cout << "Reading value failed!" << std::endl;
return -1;
}
else
{
return 0;
}
}
Console Output:
Hope you can support me with this problem.
Thanks in advance!
Is there a way to change the timezone in which the server- & source-timestamp is returned from the nodes? The timestamp I receive from the OpcUa-Server differs to the one that is shown in UaExpert by 2 hours.
Thanks in advance!
MaxChunkCount parameter of OPC UA TCP Hello message is hard coded, not configurable.
As a result, larger messages cannot be sent by server side, causing BadTcpMessageTooLarge error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.