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.

UI blocks on Write if OPC Server is not responsive

More
11 Apr 2015 15:07 #3047 by support
I understand. This is how it works, currently. (The subscriptions are inherently different; same with EasyXXClient.SubscribeXXXX - it does not block when there is a problem, too).

A possible workaround with the current version (not entirely code-less, though):

1. Do not configure the WriteEventSource (button1.Click, in your case) on the binding.

2. Instead, double click on the button in the designer, and let VS create an event handler for the click event.

3. Figure out the member name of the binding. Can be done by clicking on the bindingExtender1 below the form surface; then, in the Properties window, expand ("+") the ComposedBindingBag, select the Bindings row underneath it, and click "..." next to it. You will see a collection editor form. The member names are in the right part under Design -> (Name), and will look like "daItemBinding1" etc.

4. Fill in the event handler from Step 2 with following code, replacing the binding member name as appropriate:
new Thread(() => daItemBinding1.ExecuteWrite()).Start();
This should do it.


I take this as a very useful suggestion for improvement. It would be best if the developer is given a choice of which behavior she wants. More on this in an email to you that will follow.

Best regards
The following user(s) said Thank You: cdunlap

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

More
10 Apr 2015 14:08 #3045 by cdunlap
Hello,

I setup a binding that has the following properties:




If the OPC server is able to communicate with the PLC, I can enter a value into the text box, click the button, and the write will go through just fine.

If I unplug the cable between the PLC and the OPC Server, obviously the OPC Server is unable to communicate with the PLC. If I click the button this time, the write will certainly fail. The problem is, that while the write is attempting to occur, the rest of the UI on the form locks up and cannot be interacted with.

I notice that this doesn't happen with a subscription binding for example. Is there a way to tell the write to not block the UI while it is being attempted? One thing we can do to shorten the amount of time until the write fails is to decrease the timeout in the OPC Server so that the write failure gets sent to the client quicker, but that is just a bandaid and the true problem continues.

I appreciate your input on this. Thank you.
Attachments:

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

Moderators: support
Time to create page: 0.047 seconds