我在ANSI C堆栈中遇到OPC UA订阅和通知方面的问题。OPC UA第4部分,Service说:
5.13.1订阅模式5.13.1.1描述c)响应发布请求将NotificationMessages发送给客户端。
怎么寄来的?我真的期待着某种形式的回调,但似乎没有。它确实说这些是对“发布”请求的响应,但是发布服务调用确认收到了通知,但它似乎没有请求通知。此外,这将是轮询,订阅和监控的全部要点是不进行投票。
有人能提供一个在ANSI C中显示数据值监视的示例吗?
发布于 2015-06-23 07:27:56
这是C#代码。我希望它能对你有帮助。
private NotificationMessageReceivedEventHandler
m_NotificationMessageReceived;
// ...
m_NotificationMessageReceived =
new NotificationMessageReceivedEventHandler
(Subscription_NotificationMessageReceived);
m_subscription.NotificationMessageReceived +=
Subscription_NotificationMessageReceived;
// ...
private void Subscription_NotificationMessageReceived
(Subscription subscription,
NotificationMessageReceivedEventArgs e)
{
if (e.NotificationMessage.NotificationData == null ||
e.NotificationMessage.NotificationData.Count == 0)
{
LogMessage("{0:HH:mm:ss.fff}: KeepAlive",
e.NotificationMessage.PublishTime.ToLocalTime());
}
}https://stackoverflow.com/questions/29522824
复制相似问题