简体   繁体   English

解码 OPC-UA 扩展 object

[英]Decoding OPC-UA extension object

How does one decode extension object obtained from HistoryReadResult to HistoryData type?如何从 HistoryReadResult 中获得一个解码扩展 object 到 HistoryData 类型? I read documentation that suggessts simply using the decode() method but the only variant I can find in the source code is that of decode(EncoderContext).我阅读了建议仅使用 decode() 方法的文档,但我可以在源代码中找到的唯一变体是 decode(EncoderContext)。

You forgot to mention which stack or SDK you are using, but I can guess that it's the OPC Foundation Java Stack, in which case, you can use EncoderContext.getDefaultInstance() .您忘记提及您正在使用哪个堆栈或 SDK,但我可以猜测它是 OPC Foundation Java 堆栈,在这种情况下,您可以使用EncoderContext.getDefaultInstance() This will work fine with the standard structure types, such as HistoryData.这适用于标准结构类型,例如 HistoryData。 For server specific types, you may need to use a connection specific EncoderContext.对于特定于服务器的类型,您可能需要使用特定于连接的 EncoderContext。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM