最近兜兜转转,看了各种各样的OPC UA的库,尤其是看了OPC Foundation的库后,特别困惑,直到耐着性子看完milo库的Server例子后,对于如何写一个OPC UA服务器终于有了一定的了解。
Milo是Eclipse开源的项目之一,GitHub地址:Milo
我们直接通过Server的例程来了解整个Server是怎么运行的:
1.主体函数
public static void main(String[] args) throws Exception {
ExampleServer server = new ExampleServer();
server.startup().get();
final CompletableFuture<Void> future = new CompletableFuture<>();
Runtime.getRuntime().addShutdownHook(new Thread(() -> future.complete(null)));
future.get();
}
这是Se

本文介绍了如何使用Eclipse Milo库创建OPC UA服务器。首先,通过Server的main函数理解其运行流程,接着详细说明了证书的获取和配置,以及Server的命名空间设置,包括对象的定义和引用关系。
最低0.47元/天 解锁文章
:初识milo库&spm=1001.2101.3001.5002&articleId=104383991&d=1&t=3&u=f0c8081a9c074a87a43239079878da81)
2518

被折叠的 条评论
为什么被折叠?



