Hi,
now I have an example Code (See below) for first Historical Access, that is working. It is programmed in Milo 0.2.3.
For 0.3.0 there occur 2 failures.
Talking about:
ExampleNamespace.java
@Override
// historyRead method of AttributeHistoryManager
public
void historyRead(…){…}
(See below)
1)
ExtensionObject.encode(historyData);
Needs a “SerializationContext”-object.
“SerializationContext” and „Serialization” is not explained in specification 1.03 and it’s not having Javadoc.
ð
What to do?
2)
context.complete(results);
HistoryReadContext
Has no
complete(List<U>
value)
method any more, because
HistoryReadContext
now extends
ServiceOperationContext<HistoryReadValueId,
HistoryReadResult>
Instead of
OperationContext<T, U>
There is no
CompletableFuture<List<U>>
in ServiceOperationContext
to complete.
ð
What to do?
Thanks – Michael
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
START (MY)EXAMPLE CODE
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
ExampleNamespace.java:
[…]
@Override
// historyRead method of AttributeHistoryManager
public
void historyRead(HistoryReadContext
context,
HistoryReadDetails
readDetails,
TimestampsToReturn
timestamps,
List<HistoryReadValueId>
readValueIds) {
logger.info("Size
of list readValueIds: " +
readValueIds.size() );
// For each requested node the list readValueIds has one entry
logger.info("First
node id: " +
readValueIds.get(0).getNodeId().toString());
// Fake test data for the last minutes
DataValue
v1 =
new DataValue(new
Variant(new Double(1)), StatusCode.GOOD,
new DateTime(Date.from(Instant.now().minus(3,
ChronoUnit.MINUTES))));
DataValue
v2 =
new DataValue(new
Variant(new Double(2)), StatusCode.GOOD,
new DateTime(Date.from(Instant.now().minus(2,
ChronoUnit.MINUTES))));
DataValue
v3 =
new DataValue(new
Variant(new Double(3)), StatusCode.GOOD,
new DateTime(Date.from(Instant.now().minus(1,
ChronoUnit.MINUTES))));
// Build the HistoryData Object
HistoryData
historyData =
new HistoryData(new
DataValue[] {v1,v2,v3});
// and encode it
ExtensionObject
extHistoryData = ExtensionObject.encode(historyData);
HistoryReadResult
historyReadResult =
new HistoryReadResult(StatusCode.GOOD
, null,
extHistoryData);
// There's a lot more to do, this works only with one node
List<HistoryReadResult>
results = Lists.newArrayListWithCapacity(readValueIds.size());
for (HistoryReadValueId
readValueId :
readValueIds) {
results.add(historyReadResult);
}
context.complete(results);
}
[…]
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
END (MY)EXAMPLE CODE
##### ##### ##### ##### ##### ##### ##### ##### ##### #####
Von: milo-dev-bounces@xxxxxxxxxxx <milo-dev-bounces@xxxxxxxxxxx>
Im Auftrag von Kevin Herron
Gesendet: Donnerstag, 9. Mai 2019 14:02
An: milo developer discussions <milo-dev@xxxxxxxxxxx>
Betreff: Re: [milo-dev] Are there any examples for Historical Access?
Michael,
If you cut the scope down I think you can get something working. You're definitely going to need to Part 4 and Part 13 of the OPC UA specs though. Part 4 discusses the history services and Part 13 discusses aggregates.
Start with something like this:
- The *storage* of data is out of scope. You already have some database with samples for various points in it.
- Implement the History Read service against this database.
- Support only a few simple aggregates like Average, Minimum, Maximum
The bulk of the work would be probably be implementing the aggregates, which I imagine would be more generic data processing code than it would be OPC UA specific. Implementing History Read is just plumbing: interpret the request, make
a call to a database, run the data through the requested aggregate, return the values.
Annex A in Part 13 defines all the aggregates and even includes sample data and results for each aggregate to help explain the behavior.
Hey Kevin,
thanks for your response and the Client Example.
Well – then it is my job now to do this. It is part of my project which runs till July
2019.
A)
Imagine
you would implement it. How much hours would you need?
B)
Image
I as a PEBKAC User would implement it. For simplicity: I would start on Monday and it must finish on Friday the week after – 2 weeks, 76 hours. Do you think it is possible for me?
I didn’t know that HistoryReadValueId exists, until I saw your Code. As I know there is
no API nor a Javadoc available for Milo. I didn’t read the specification nor your sourcecode right now. I only made some read and subscribe-examples runnable and saved data to a database.
I need to implement HA only with main functions. It does not need to satisfy all complexity
from the specification. For example we don’t take care of security, right now. It just needs to run.
Implemention in detail could be the job in a master thesis, which could take place in
autumn 2019 for 5 months (~600 hours)
Thanks - Michael
Von:
milo-dev-bounces@xxxxxxxxxxx <milo-dev-bounces@xxxxxxxxxxx>
Im Auftrag von Kevin Herron
Gesendet: Mittwoch, 8. Mai 2019 17:46
An: milo developer discussions <milo-dev@xxxxxxxxxxx>
Betreff: Re: [milo-dev] Are there any examples for Historical Access?
I'm not aware of anybody implementing the historical services in the server though. They are pretty complex when you consider the implementation of all the aggregates as well.
Did somebody implement Historical Access with Milo?
Thanks - Michael
SEEBURGER AG
|
|
Vorstand/SEEBURGER Executive Board:
|
Sitz der Gesellschaft/Registered Office:
|
|
Axel Haas, Michael Kleeberg, Axel Otto, Dr. Martin Kuntz, Matthias Feßenbecker
|
Edisonstr. 1
|
|
|
D-75015 Bretten
|
|
Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
|
Tel.: 07252 / 96 - 0
|
|
Prof. Dr. Simone Zeuchner
|
Fax: 07252 / 96 - 2222
|
|
|
Internet:
http://www.seeburger.de
|
|
Registergericht/Commercial Register:
|
e-mail:
info@xxxxxxxxxxxx
|
|
HRB 240708 Mannheim
|
Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten.
Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung,
Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Gattinger. Michael) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge
auf Viren zu prüfen.
This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional
secrecy. Any fact or opinion contained, or _expression_ of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding,
copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Gattinger. Michael) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev
SEEBURGER AG
|
|
Vorstand/SEEBURGER Executive Board:
|
Sitz der Gesellschaft/Registered Office:
|
|
Axel Haas, Michael Kleeberg, Axel Otto, Dr. Martin Kuntz, Matthias Feßenbecker
|
Edisonstr. 1
|
|
|
D-75015 Bretten
|
|
Vorsitzende des Aufsichtsrats/Chairperson of the SEEBURGER Supervisory Board:
|
Tel.: 07252 / 96 - 0
|
|
Prof. Dr. Simone Zeuchner
|
Fax: 07252 / 96 - 2222
|
|
|
Internet:
http://www.seeburger.de
|
|
Registergericht/Commercial Register:
|
e-mail:
info@xxxxxxxxxxxx
|
|
HRB 240708 Mannheim
|
Dieses E-Mail ist nur für den Empfänger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten.
Jegliche darin enthaltene Ansicht oder Meinungsäußerung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empfänger, so haben Sie diese E-Mail irrtümlich erhalten und jegliche Verwendung,
Veröffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender (Gattinger. Michael) übernehmen die Haftung für Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anhänge
auf Viren zu prüfen.
This email is intended only for the recipient(s) to whom it is addressed. This email may contain confidential material that may be protected by professional
secrecy. Any fact or opinion contained, or _expression_ of the material herein, does not necessarily reflect that of SEEBURGER AG. If you are not the addressee or if you have received this email in error, any use, publication or distribution including forwarding,
copying or printing is strictly prohibited. Neither SEEBURGER AG, nor the sender (Gattinger. Michael) accept liability for viruses; it is your responsibility to check this email and its attachments for viruses.
_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/milo-dev