Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Dear Community
We have an issue and an outstanding support ticket relating to the OPC DA Client, version 5.6.1.
Using the default OpcDaThing.config file as a starting point (as supplied with the download), we are unable to get the service to connect to our platform.
Errors from the OPC DA Client log files are as follows:
2016-02-17 11:49:01.157Z [L: Warning] [T: 6] [U: SYSTEM] [O: com.thingworx.Configuration] Could not get auto connect value from configuration, using default. : System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at com.thingworx.opcda.OpcDaConfiguration.get_AutoConnect()
2016-02-17 11:49:01.157Z [L: Error] [T: 6] [U: SYSTEM] [O: com.thingworx.opcda.OpcDaClient] Error while initializing new OpcDaThing, or opening connection to Platform:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at com.thingworx.opcda.OpcDaConfiguration.get_OpcItemsConfigTable()
at com.thingworx.opcda.OpcDaThing.Init()
at com.thingworx.opcda.OpcDaThing..ctor(String name, String description, String identifier, ConnectedThingClient client)
at com.thingworx.opcda.OpcDaClient.run()
The AutoConnect property refers (we think) to the AutoConnect value in OpcDaThing.config in the section relating to OPC connections, i.e. AutoConnect to OPC server on startup. Our file includes the following lines, so we assume we have configured correctly:
"rows": [{
"ServerName": "myOpcPath", //real OPC path removed here :-)
"GroupName": "Twx",
"ItemDelimiter": ".",
"UpdateRate": 60000,
"AutoConnect": true,
"ReadTagsOnInitialAdd": false,
"ReadTagsOnInitialAddMaxAge": 600000
}]
We aren't sure about "The given key was not present in the dictionary" in the second error.
We tried switching on Verbose logging in the ThingWorxOPCService.exe.config file but did not receive any further error details in the log files.
Has anyone else come across this issue, or have any suggestions?
Pat, I just tried to install the 5.6.1 (using the default OpcDaThing.config), and I could connect to my OpcThing (with my Matrikon sim). The only issue I had was with ssl connectivity (I'm looking into that now), but I can get it connected when setting the IsSecure flag to false. My AutoConnect is set to false as well.
Hi Aanjan
I have identified the issue I had, so wanted to share and save your time.
When doing version upgrade of the OPC DA SDK 5.6.0 to 5.6.1, the host computer MUST be rebooted.
If not, the property "ConnectRetries" will not accept the default value "-1" due to it's definition as being a UInt data type.
Following a reboot, it works beautifully. :-)
Thanks Aanjan
Thanks for the confirmation, Pat! The default connect retries were set to 100 in the old versions I believe, and now has been switched to -1 for infinite retries. I was messing around with the config file to check if I could reproduce what you are seeing, but glad to see you've resolved it!