Author Topic: OPC With Codesys V3 - doesn't work  (Read 2720 times)

hypnotize

  • Newbie
  • *
  • Posts: 7
    • View Profile
OPC With Codesys V3 - doesn't work
« on: May 01, 2017, 04:54:12 AM »
I am trying for almost a week to get Codesys V3 opc server to work with OPCDACOM driver in AdvacnedHmi but no success.
I tried to link the digital meter PLCAdressValue to the variable but the error I get, which appears as a text field on the digital meter is "CoCreateInstanceEx : access is denied" and after few seconds, it turns into "object reference not set to an instance of an object"

I checked with UA EXPERT free OPC client and the server in Codesys is running and I can read the variables.
my settings:
OPCServer in the OpcDaComx is CoDeSys.OPC.DA
OPCServer Patch in the OpcDaComx is   opcda://192.168.0.3:4840

PLCAdressValue in digital meter: PLC_GW3..Speed1         where PLC_GW3 is the server name according to Codesys OPC Configurator.   Speed1 is the name of the variable.

PLEASE HELP!!! 



Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Re: OPC With Codesys V3 - doesn't work
« Reply #1 on: May 01, 2017, 05:13:01 AM »
Is your OPC server running on a different PC than you are running AdvancedHMI?

hypnotize

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: OPC With Codesys V3 - doesn't work
« Reply #2 on: May 01, 2017, 05:26:54 AM »
Yes, on a different computer.
I also ran the UA expert free PLC client program on the remote PC where advancedHMI is located and it discovered the Codesys OPC with no problem.

Do I need to run it on the same computer? and then set 127.0.0.1 as the IP?

hypnotize

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: OPC With Codesys V3 - doesn't work
« Reply #3 on: May 01, 2017, 05:44:40 AM »
If I run it in the local computer, I set the OPCServerPath = opcda://localhost  (the default setting)

and the error I get in the digital meter is : "failed OPC subscription start (OpcDaCom)"

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Re: OPC With Codesys V3 - doesn't work
« Reply #4 on: May 01, 2017, 07:38:40 AM »
It sounds like when it is on the remote PC you are having the typical DCOM issues:

https://www.opcsupport.com/link/portal/4164/4590/Article/3112/What-is-Security-DCOM-Error-with-error-code-0x80070005

On the local PC, I think it can't communicate with CodeSys.

I'm a little unsure about the client program you are using. Does the UA mean it works with a UA (not a DA) server or is UA the initials of the company? I would try this test client since I know it is a DA:

https://www.matrikonopc.com/products/opc-desktop-tools/opc-explorer.aspx