Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

connexion to a opc server GUI with windows service

More
13 Nov 2020 09:03 #9142 by support
Good, thank you for letting me know, I am glad that it works now.
I would still be interested in knowing which concrete OPC server are we discussing here.

Best regards

Please Log in or Create an account to join the conversation.

More
13 Nov 2020 08:29 #9140 by PhilippeG
Hello,

The OPC server is a vendor
I didn't see the server in DCOM Config, because the executable is a 32 bit DCOM Application

II executed the command C:\WINDOWS\SysWOW64>mmc comexp.msc /32
I see it now. I configured the server to start with interactive user account, and now it works.


Regards

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 13:40 #9117 by support
What OPC server are we talking about? (vendor, model).

Normally, all OPC servers appear/should appear in DCOM configuration - even if they do *not* run as Windows service.
Yeah, maybe the in-process servers would not appear, but then, it is unlikely that an in-process server would have a user interface (at least not driven by the same code/in the same process) - and if it did, it would be a bad design choice, because the client can be a Windows service and then the server would also run without a chance to shown a UI.

All in all, there are too many weird things about this setup.

Do you know how to check the server's entries in the registry? From there, we could at least figure out whether it is in-proc or not.

Best regards

Please Log in or Create an account to join the conversation.

More
10 Nov 2020 12:42 #9116 by PhilippeG
Hello,

The opc server is not a windows service, it 's an windows application (maybe a inprocserver )
The opc server doesn't appear in dcomconfig

The opc client is executed in a windows service launch with the same account than the windows application

Regards,

Please Log in or Create an account to join the conversation.

More
09 Nov 2020 15:55 - 09 Nov 2020 15:55 #9107 by support
Hello,

0xC0040008 corresponds to OPC_E_INVALIDITEMID. It is not generated on the client side: It is the OPC server that is responding with this error.
It is surprising to see this error code come up differently based on the client application (provided that the same Item ID is being used), as the validity and presence of OPC Items IDs (in the server) should not really depend on such things. Therefore, there must be some indirect independence.

One thing to check is how the "Identity" of the OPC server is configured (in DCOM - on the Identity tab of the server properties). What is your setting there?
And, use the Task Manager to look for the server process (on the Details tab), and check a) whether the server runs under the expected account ("User name" column), and b) that you accidentally do not see two or more server processes running (this can happen e.g. when the server's Identity is set to Launching user and programs running under different users are starting it).

Where I am getting with these? Well, the error you are getting looks more like that the OPC server has not actually properly or fully loaded its configuration. And I have seen that happening when it was run under the wrong account, due to permissions, and even configuration (a server might be storing the configuration *per user*).

I do not quite get this part of your post: "Is it possible to disable the auto reconnexion to the server OPC?" - is that an unrelated question? If so, please post it separately.

Best regards
Last edit: 09 Nov 2020 15:55 by support.

Please Log in or Create an account to join the conversation.

More
09 Nov 2020 15:32 #9106 by PhilippeG
Hi,

I developped a c# windows service OPC client
The OPC server is an GUI application
I configure the DCOM security for everyone

I have error HResult = 0xC0040008 when i tried to read an item
If I execute the same code in a GUI application, it's works

Is it possible to disable the auto reconnexion to the server OPC?

Best regards

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.058 seconds