HRESULT: 0xC0040007 Exception with VB.NET and Mitsubishi|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
HRESULT: 0xC0040007 Exception with VB.NET and Mitsubishi
Avatar
Claudio Somorrostro
New Member
Members
Forum Posts: 2
Member Since:
03/06/2016
sp_UserOfflineSmall Offline
1
03/28/2016 - 14:48
sp_Permalink sp_Print

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)

Avatar
Guest
Guests
2
03/28/2016 - 14:54
sp_Permalink sp_Print

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.

Avatar
Claudio Somorrostro
New Member
Members
Forum Posts: 2
Member Since:
03/06/2016
sp_UserOfflineSmall Offline
3
03/29/2016 - 07:51
sp_Permalink sp_Print

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

Avatar
Guest
Guests
4
03/29/2016 - 08:34
sp_Permalink sp_Print

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.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 13
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1349
Posts: 4577