AdvancedHMI Software
General Category => Support Questions => Topic started by: maxketcham on August 22, 2016, 11:33:07 AM
-
using OpcDaCom, I am tryint to connect to an OPC server on a remote server the server address is 10.224.220.109 using OPC expert https://opcexpert.com/ I can connect by just adding the address of the opc server and it finds Kepware.KEPServerEX.V5 and allows me to connect to it. Why can't I connect to it with Advanced HMI? I have tried changing opcda://localhost to remotehost, the IP address, and several other thnigs but nothing seems to work. What am I doing wrong?
-
I hate to say it, but every time I see OPC come up in a topic, I cringe. OPC is based on an old Microsoft technology that can be horribly difficult to get it to connect, especially on remote servers.
The top issue is usually getting the OPCServerName correct. It looks like you have identified that, so make sure the OPCServerName property has Kepware.KEPServerEX.V5
For remote connections, the next thing is the OPCServerPath. In your case it looks like this should be opcda://10.224.220.109
I do not thing KepWare uses topics, so the OPCTopic should be left blank.
This now leaves the correct addressing to put in the PLCAddress* properties. This will depend on your device.
-
LOL, I can understand that feeling of cringing. I did get it using your method, turned out when I checked it was a DCOM problem, that is fixed, now I can connect, but the connection will only last 2-3 changes of a bit, then never changes again. This I have no clue about. Your driver does do a callback does it not? or does it poll?
-
The driver uses the subscription and call back provided by the OPC server. In Solution Explorer, you can expand down the AdvancedHMIDrivers project to see OpcDaCom.vb, right click that file and select View Code
Scroll down to line 525. This is where the callback comes to. You can click in the left margin to add a breakpoint and see if the callback continues to occur.
-
nope, never called back, it initializes them all to false, then updates once, but callback is never activated. Guess I'm down to polling
-
The driver does an initial read to get the current value, but then relies on the callback to continue the updates. For whatever reason, the read seems to work, but OPC subscriptions do not.
-
no matter, Callback would have been convenient, but I can poll just as effectively so that's what I'll do. besides I only need to write and read every second or so for the poll and it will only be 16 bits this time. Love your software, has made my life a lot easier so no complaints.
Thanks for the help