03/06/2016
Hi, my name is Claudio. I’m Researching about PLC and VB integration with good results with Allen Bradley PLC. Anyway, now i’mt trying to integrate a Mitsubishi PLC, but my code are failed when i use it with a Mitsubishi PLC. Error is: HRESULT: 0xC0040007
Maybe someone can help me with this. Thanks very much
The Code:
Imports OPCAutomation
Imports MXOPCLib
Imports OpcEnumLib
Mensaje = “Conectando con el servidor OPC…”
ServidorOPC = New OPCServer
ServidorOPC.Connect(“Mitsubishi.MXOPC”)
Mensaje = “Añadiendo grupo al servidor OPC…”
GruposOPC = ServidorOPC.OPCGroups
GrupoOPC = GruposOPC.Add(“Grupo1”)
GrupoOPC.IsActive = True
GrupoOPC.UpdateRate = 1000
GrupoOPC.IsSubscribed = True
Mensaje = “Añadiendo Items al grupo…”
ReDim ItemOPC(100) ‘Dimensionar según las necesidades
‘************************* Nueva lista de variables PLC
ItemOPC(0) = GrupoOPC.OPCItems.AddItem(“Lijadora.SeteoEspesor”, 0)
Hello Claudio,
It seems that the code (0xc0040007) is coming from the OPC Server, which is saying that the item you have specified does not exist. Check the syntax of your tag “Lijadora.SeteoEspesor”.
The error codes you receive can provide very useful information. Use Google and search “opc 0xc0040007” etc. for future error codes.
I hope this helps.
03/06/2016
Hello Nathan.
I saw this response in some forums PLC but the Tag exists and I can see it in the MX Configurator. I tried the tag as “Lijadora.SeteoEspesor” or “SeteoEspesor” or as the “I / O Address” and in all cases fails. Therefore, I think the error should be another why I turn to this forum.
From already thank you very much for your help and if anyone knows the answer will be very grateful.
PS the same code with Allen Bradley PLC is working properly
the caps of MX Configurator Tag: https://www.dropbox.com/s/9xhf…..C.png?dl=0
Hello Claudio,
Now that is interesting…
So the tag name is definitely confirmed in your screenshot. But the Client is different from YOUR client, and I think we need to look at this a little closer…
I am wondering if our nemesis COM/DCOM is at work here. Could more than one instance be running? Could you open the Windows TASK MANAGER on your OPC Server computer and observe the Processes tab. Locate your OPC Server’s process within the list and note the user-context (possibly a username or SYSTEM).
Now launch your Client application and do not let it shut down. Keep it open. Take another look at the Task Manager and see if your OPC Server is listed more than once.
If you see your Server is listed multiple times then change your Server to run as a Service, or as a specific named user account.
If your Server is listed only once, then I would suggest reviewing the OPC Servers’ application log and then contacting the Server vendor for assistance.
As a last resort, you could put the OPCAnalyzer between the client/server and observe the calls. You could use this technique to compare your custom client vs. the client in the screenshot.
I hope this helps.
1 Guest(s)