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.

Freeze the whole application

More
09 Aug 2023 14:30 #11983 by support
Oh, thank you.
No need to delete unless you insist there is a necessity.

If there is a lesson learned - a solution you have found - we would welcome if you share it too.

Best regards

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

More
09 Aug 2023 12:40 #11982 by mozesa
Replied by mozesa on topic Freeze the whole application
Consider it irrelevant. Problem solved.

You can delete it.

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

More
09 Aug 2023 08:47 #11981 by mozesa
await UADataChangeNotificationObservable
            .Create<bool>(_endpointDescriptor, _presenceSensorId, samplingInterval: 500)
            .ObserveOn(TaskPoolScheduler.Default)
            .Skip(1)
            .Select(x => x switch
            {
                { TypedAttributeData.TypedValue: true } => OperationTaskStatus.Ok,
                _ => OperationTaskStatus.Nok,
            })
            .StartWith(OperationTaskStatus.New)
            .FirstAsync(x => x is OperationTaskStatus.Ok)
            .ToTask(cancellationToken, scheduler: TaskPoolScheduler.Default)
            .ConfigureAwait(false);

The above snippet works fine, but when the OPC UA server is offline, and I signal a cancel via the passed in cancellationToken, it freezes the whole application. I mean the whole GUI is got freeze. Even though it is wrapped by default a Task.Run. I checked, the code is running in .NET ThreadPool Worker. As you can see I set the scheduler as well, but no effects - the application gets freeze because of this code.

Thanks for your help in advance.

Best Regards,

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

Moderators: support
Time to create page: 0.055 seconds