我正在尝试从opc服务器获取标签的历史数据,但是我得到了'BadServiceUnsupported‘错误。我已经为KepserverEX V6中的特定标记配置了Opc服务器和本地历史记录。
我正在使用这个opc库https://github.com/OPCFoundation/UA-.NETStandard。
我成功地读取了标记值,但在调用HistoryRead方法时,我遇到了历史数据的问题:
m_Session.HistoryRead( null, new ExtensionObject(details), TimestampsToReturn.Source, false, nodesToRead, out results, out diagnosticInfos);
获取“BadServiceUnsupported”异常。“”
我也在KepserverEx的项目设置中启用了HDA连接,但似乎没有解决这个问题。
我如何解决这个问题?
发布于 2019-02-15 00:07:53
在这种情况下,没有什么需要修复的。Kepserver仅支持OPC Classic (COM/DCOM)的HDA,不支持OPC UA。
发布于 2019-04-05 09:22:04
要解决这个问题,您可以运行OPC UA Wrapper Server:https://github.com/OPCFoundation/UA-.NETStandard/blob/master/ComIOP/README.md
包装器服务器将成为应用程序和KepServerEX之间的桥梁。它是这样的:
[Your Application] --- (OPC-UA) ---> [OPC UA Wrapper Server] --- (OPC-HDA) ---> [KepServerEX]
我已经测试了上面的场景,使用m_Session.HistoryRead()
我可以成功地从KepServerEX v6.6中读取历史值
为了让服务器包装器打开到KepServerEX的HDA连接,打开Opc.Ua.ComServerWrapper.Config.xml
并为HDA启用ComClientConfiguration
。它应该看起来像这样:
<ComClientConfiguration i:type="ComHdaClientConfiguration">
<ServerUrl>opc.com://localhost/Kepware.KEPServerEX_HDA.V6/{5C905440-YOUR_CLSID_HERE}</ServerUrl>
<ServerName>HDA</ServerName>
<MaxReconnectWait>10000</MaxReconnectWait>
<SeperatorChars></SeperatorChars>
<AddCapabilitiesToServerObject>true</AddCapabilitiesToServerObject>
<AttributeSamplingInterval>1000</AttributeSamplingInterval>
<TreatUncertainAsBad>true</TreatUncertainAsBad>
<PercentDataBad>0</PercentDataBad>
<PercentDataGood>100</PercentDataGood>
<SteppedSlopedExtrapolation>false</SteppedSlopedExtrapolation>
</ComClientConfiguration>
https://stackoverflow.com/questions/54694113
复制相似问题