Professional OPC
Development Tools

logos

Error in Live Binding when closing WPF Application

More
23 Sep 2019 08:31 #7753 by support
Hello.

We were able to reproduce the problem. It appears to do with the switching of the pages; when the application is closed, the Unloaded event does not get generated for the active Page.

We will think about how to prevent this in our code. For now, however, there is a workaround. Please add the following to PageWelcome.xaml.vb :

Class PageWelcome
    Private Sub PageWelcome_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
        AddHandler Dispatcher.ShutdownStarted, AddressOf Dispatcher_ShutdownStarted 
    End Sub
 
    Private Sub Dispatcher_ShutdownStarted(sender As Object, e As EventArgs) 
        bindingExtender1.Online = false
    End Sub
 
....
 
End Class
Note: You probably want to remove the following part of your code - it may be a leftover from some experiment, and is not being called:

Public Sub unbindLiveBinding()
        pointBinder1.Dispose()
    End Sub
Best regards

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

More
20 Sep 2019 06:00 - 20 Sep 2019 06:00 #7749 by admin
Hello,

thank you. I have downloaded the attachment and removed it from the forum post. We are working on it.

The attachment was:
File Name: VB_Projekt...09-19.7z
File Size:13,954 KB

Regards
Last edit: 20 Sep 2019 06:00 by admin.

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

More
19 Sep 2019 12:23 - 20 Sep 2019 06:00 #7742 by treams-gmbh
(attachment removed)

You will find a minimized project as an attachment. There is a screenshot from the Holding Mode when I close the application.
I removed the license file from the project.

If there is no need to keep the project in the forum, please delete it.

Regards
Attachments:
Last edit: 20 Sep 2019 06:00 by admin.

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

More
19 Sep 2019 11:51 #7740 by support
Please upload the source files of the project, zipped, to the forums (unless it is somehow confidential), as an attachment to the forum post.

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

More
19 Sep 2019 11:44 #7739 by treams-gmbh
Hello,

Yes, of course I can send you a minimized project. Where can i send it to?

My currently workaround is to dispose the Pointbinder before closing:

pointBinder1.Dispose()

Regards

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

More
19 Sep 2019 11:18 #7738 by support
Hello,

we cannot reproduce the issue. Can you send a small project that would allows us to reproduce it here?

Best regards

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

More
18 Sep 2019 12:08 #7735 by treams-gmbh
Hi,

I have implement a live binding in a WPF Application. The binding is working well but when I close the application i got the following error message:

(QickOPC 2018.3)

System.ArgumentException: OPC-DA subscription handle is invalid.
Parametername: handleArray[0]
bei OpcLabs.BaseLib.Utilities.ExceptionUtilities.CheckExceptions(IEnumerable`1 exceptions)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.Operate[TPointActor](IEnumerable`1 pointBindings, Predicate`1 bindingPredicate, Func`2 getParametersFunc, Predicate`1 supportsPredicate, Func`2 getArgumentsTypeFunc, TPointActor actor, ArgumentDirections argumentDirections, Action`3 action, Func`3 succeededFunc)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.InternalSubscribe(Boolean active, IEnumerable`1 pointBindings)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.<>c__DisplayClass72_0.<Subscribe>b__0()
bei OpcLabs.BaseLib.LiveBinding.PointBinder.ExecuteOperationDirect(Action operation)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.ExecuteOperation(Action operation)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.Subscribe(Boolean active, IEnumerable`1 pointBindings)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.Subscribe(Boolean active, IEnumerable`1 bindingGroups)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.Subscribe(Boolean active, PointBindingGroup bindingGroup)
bei OpcLabs.BaseLib.LiveBinding.PointBindingGroup.ExecuteSubscribe(Boolean active)
bei OpcLabs.BaseLib.LiveBinding.PointBindingGroup.MakeLinks(Boolean make)
bei OpcLabs.BaseLib.LiveBinding.AbstractBindingGroup.set_OnlineBinder(AbstractBinder value)
bei OpcLabs.BaseLib.LiveBinding.BinderBase.SetGroupsOnlineBinder(AbstractBinder onlineBinder)
bei OpcLabs.BaseLib.LiveBinding.PointBinder.OnOnlineChanging(Boolean newValue)
bei OpcLabs.BaseLib.LiveBinding.BinderBase.set_Online(Boolean value)
bei OpcLabs.BaseLib.LiveBinding.BindingExtender.SetProvidersOnline(Boolean online)
bei OpcLabs.BaseLib.LiveBinding.BindingExtender.OnOnlineChanged()
bei OpcLabs.BaseLib.LiveBinding.BindingExtender.Dispose(Boolean disposing)
bei System.ComponentModel.Component.Finalize()


What can I do?

Thanks

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

Moderators: support
Time to create page: 0.210 seconds

      

 Recommend this on Google