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.

Siemens's SIMATIC NET OPC UA server dropps connection with PLC

More
27 Jul 2018 11:46 #6554 by support
OK, thanks for details.

There is not much I can add, though. It is the server's responsibility to maintain the connections to the underlying systems, and it is the server's responsibility to fulfill the Read with valid data if possible. The server seems to be failing at that, and it is therefore the server side where this should primarily be resolved.

Best regards

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

More
26 Jul 2018 06:44 #6546 by muchan
Thank you for your detailed reply.

Usually when I see that connectionstate is not 20, I don't try to Read because it never succeeds.
But I made change and tried to read when connectionstate is not good.

At ReadValue I get exception:

An OPC-UA operation failure with error code -1 (0xFFFFFFFF) occurred, originating from ''. The inner exception, of type 'OpcLabs.EasyOpc.UA.UAStatusCodeException', contains details about the problem.

Inner exception:
InnerException (System.Exception) {"Status is not good: BadTimeout."}
System.Exception {OpcLabs.EasyOpc.UA.UAStatusCodeException}

I got a code that Siemens AG uses for their sample .NET program with OPC foundation's DLL.
It seems to reconnect at read after some seconds. I'm seeking differences with my code.

Thank you.

Best regards

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

More
25 Jul 2018 17:54 #6545 by support
Hello,

I understand the issue. Whatever happens between the OPC UA server code and the actual hardware is generally, however, outside of control of any OPC client. Normally, the server is expected to assure connections to the downstream systems automatically - for reads, writes, subscriptions etc., without the client having to do anything for that.

We do not do anything "magical" in QuickOPC's SubscribeDataChange. Only the things that are necessary and that every client has to do: Creating a subscription, adding monitored items, etc.

Some servers need time to set things up. In this case, if you subscribe, you may not notice anything, because the server will eventually send the data, when it becomes available. But the behavior of such servers in case of Read (from device) is not always the same. Some servers may block the call until the data becomes available. Others may simply return an error (or bad status). The data may become available later, so the next Read may succeed. It is possible that this is your case, but it is just one of the possibilities, and I cannot be sure.

All in all, the question is more about server behavior, so it should rather be directed at the server vendor.

What exception or status code do you get when you do the Read and the server is not connected to the PLC?

Best regards

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

More
25 Jul 2018 11:06 #6544 by muchan
Hi, I'm new to this forum.

I'm developping a application to read/write data on Simens's PLC, via SIMATIC NET OPC UA server.

First I wrote a working version using OPC foundation's .NET DLL, later, after our company purchased
QuickOPC, using OPCLabs EasyOpcUa DLL. Both version works properly.

My problem is, that the connection between OPC UA Server and PLC sometimes drops.
or when the PLC is off when OPC UA server started running, then UA server does not detect that the PLC started running later.

Simens's OPC UA Server for their S7 PLC has variable "connectionstate",
(example: opc.tcp://localhost:55101/; ns=3;s=S7_connection1.connectionstate )
which s 20 (or 19) when PLC is connected, and 17 or 18 when not connected.
When this is value is not 20 (or 19) Read or Write oparation on any tags fails.

I need a way to make UA server connect to PLC, from UA client code.

With OPC foundation's DLL (Opc.Ua.Core and Opc.Ua.Client) I could not make server connect to PLC.
With OPCLabs EasyOpcUa, when I subscribe to a tag (using EasyUAClient.SharedInstance.SubscribeDataChange)
UA server magically reconnect to PLC, but with normal read/write action (using EasyUAClient.ReadValue or WriteVaue)
UA server does not reconnect to PLC.

I wonder what SubscribeDataChange does behind the scene to make UA server reconnect, what ReadValue does not.

My program does not need Subscriotion for its own purpose. I wish I can find what I can do to make server reconnect before reading value, when connection between UA server and PLC is down.


With best regard
Mutsumu Nomura a.k.a Muchan

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

Moderators: support
Time to create page: 0.046 seconds