1

有人知道为什么最新的 OPC.UA.Core.dll 中缺少 UaTcpBinding 绑定类吗?

创建 ApplicationConfiguration.TransportConfiguration 时,我认为您必须将 TransportConfiguration 添加到集合中,例如:

Instance_of_ApplicationConfiguration.TransportConfiguration.Add(
    new TransportConfiguration
    (Utils.UriSchemeOpcTcp,typeof(Opc.Ua.Bindings.UaTcpBinding)));

使用默认的“opc.tcp”传输创建 ApplicationConfiguration 是否有技巧?

UaTcpBinding 出现在 OPC.UA.Core.dll v1.0.238.1

UaTcpBinding 不在 OPC.UA.Core.dll v1.2.336.0 中

4

1 回答 1

0

听起来您对最初的 WCF 样式绑定很熟悉。有些仍然存在于最新版本中:

// Opc.Ua.BindingFactory
private static void AddDefaultBindings(Dictionary<string, Type> table)
{
    table.Add("http", typeof(UaSoapXmlBinding));
    table.Add("net.tcp", typeof(UaSoapXmlOverTcpBinding));
    table.Add("net.pipe", typeof(UaSoapXmlOverPipeBinding));
}

但是新版本更喜欢使用 Session.Create(),它经过硬编码来查找以“opc.tcp”(或“https”)开头的端点,并将创建一个 TcpTransportChannel(或 HttpsTransportChannel)。

不再需要设置 TransportConfiguration。

于 2015-08-28T15:10:12.557 回答