One representation of formulas with the implementation of calculation variables for the open62541 OPC UA server.

53 views
Skip to first unread message

Alex Artemenko

unread,
Apr 3, 2024, 4:44:24 AMApr 3
to open62541
Hello Everyone!!!
I try to code the  example and one publications obout my view to use calculated variables by formulas in open62541.
I would be grateful to anyone who can share their thoughts on this issue.

Julius Pfrommer

unread,
Apr 3, 2024, 6:19:02 AMApr 3
to open62541
Nice!
I just added a comment on LinkedIn.
Copied below.

> Using a JIT compiler for OPC UA value expressions is a good idea!
> I wasn't even aware of that feature.
> This furthermore reminds me of OPC UA Event Filters which we support in open62541 already.
> It might be possible to reuse the EventFilter "byte code interpreter" and extend it with computational expressions like PLUS/MINUS/MULTIPLY/LOG/SIN/COS/AVERAGE and IF/ELSE.

Regards, Julius

Alex Artemenko

unread,
Apr 5, 2024, 4:07:21 AMApr 5
to open62541
Hello, Julius!!
I find at cern forum the similar solution with c++ interpreter cling from CERN.
I think it is possible call cling fom c...
"Code is passed to cling as a string. You can use Interpreter::evaluate to receive the object back as a Value, or even simpler, you use the same approach you could use for passing values into cling: passing the address of a variable, that the code run inside cling will access, eg using Interpreter:: process. Example code snippet:
int out = 42; int in = 17; stringstream sscode; sscode << "*((int*)" << &out << ") = *((int*)" << &in << ") * 2"; interp.process(sscode.str());
Now, out is 34."

Alex Artemenko

unread,
2:17 AM (9 hours ago) 2:17 AM
to open62541
Hello Everyone!!!
I try to use C++ Interpreter Cling for implementation calculated variables in QUaServer - qtwrapper over open62541:QUaServer, Cling, open62541, calculated variables,
I think,  Cling can be use with open62541 natively, but only with Clang compiler...
With best regards,
Alexander 

Julius Pfrommer

unread,
3:05 AM (8 hours ago) 3:05 AM
to open62541
Hey there,

This looks very interesting.
Your work is somewhat related to the EventFilter query language that was recently added to open62541.
Attached is the manuscript for an upcoming publication (ETFA 2024).

Some of the results you could also integrate. As this is now part of the master branch.
Like the "relative addressing" with the human-readable RelativePath / SimpleAttributeOperand.

Regards, Julius
ETFA24 OPC UA EventFilter Query Language.pdf
Reply all
Reply to author
Forward
0 new messages