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.

Errorcode doesn’t belong to OpcException anymore

More
17 Nov 2021 20:05 #10359 by support
Hello.

In your catch handler, do something like (I have not tested it in the compiler but I believe it is basically correct):

var comException = ce.InnerException as COMException;
if (!(comException is null))
{
    uint WriteError = (uint)comException.ErrorCode - 0xC0041000;//0xC0041000 is coming from the server.
    switch (WriteError)
    {
...
Best regards

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

More
17 Nov 2021 19:53 - 17 Nov 2021 20:02 #10357 by BertilG
Hi Z,

I have upgraded QuickOPC Classic from version 5.53.315.1 to version 5.62.456.1

When I compile I have an error saying that Errorcode doesn’t belong to OpcException anymore. Any suggestion or alternative for this?

My old code:
try
{
     easyDa.WriteItemValue(server, dai, value);
}
catch (OpcLabs.EasyOpc.OperationModel.OpcException ce)
{
     uint WriteError = (uint)ce.ErrorCode - 0xC0041000;//0xC0041000 is coming from the server.
 
     switch (WriteError)
     {

Best regards
BertilG
Last edit: 17 Nov 2021 20:02 by support.

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

Moderators: support
Time to create page: 0.068 seconds