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.

"BadTooManySessions" Problem

More
18 Feb 2021 17:01 #9462 by Isaac Caparros Salva
Thank you for the quick reply.

It's possible that the error is caused by abrupt closings. I will make some tests without using breakpoints and debug mode.

Thanks, again! :) :)

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

More
18 Feb 2021 16:43 #9461 by support
Hello.

The answer depends on how you are closing the application. Under normal circumstances, QuickOPC closes all open sessions properly, and you do not have to do anything special. If the session keeps "accumulating" on the server, something is wrong, and there are basically two options:

a) server bug,
b) client bug (including QuickOPC bug), or
c) client mishandling.

By "client mishandling", I mean unusual terminations of the client process. For example, if you are running your program under debugger, and use the "Stop" command to abruptly end the debugging. For myself, I do this quite commonly whenever I reach the point in the debugging which gives me enough information - so one needs to be careful not to do that if the session(s) should be closed. Or, if you use the Task Manager to kill process.

Note that even in this case, after some time the server should get rid of the session internally, and make the "slot" available for new sessions. But the time might be relatively long. It is usually configurable on the server side.

If you are not doing anything like that, the remaining options are a) server bug, and b) client bug. In order to tell which one is the case, it would be necessary to see the communication between the client and the server, and check whether the client is properly closing the session or not. You will need Wireshark for that - see kb.opclabs.com/Collecting_information_for_troubleshooting .

Best regards
The following user(s) said Thank You: Isaac Caparros Salva

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

More
18 Feb 2021 15:33 #9460 by Isaac Caparros Salva
I have the same error.

I have to test an application and after starting the project a couple of times the OPC UA server returns me this error:

"OPC-UA service result - (no description available) = BadTooManySessions.\r\n---- SERVICE RESULT ----\r\nStatus Code: {BadTooManySessions} = 0x80560000 (2153119744)\r\n\r\n+ The SDK action called was \"static Session.Create\".\r\n+ The client method called was 'ReadMultiple'."

I don't know if there is a form to close correctly the client session to avoid this problem.

I use this code:
//Create client
_client = new EasyUAClient();

//Readed variables from OPC UA sever
_readVariables = new UAReadArguments[5];

_readVariables[0] = new UAReadArguments(_endpointUrl, "ns=4;s=PcConfiguration");
_readVariables[1] = new UAReadArguments(_endpointUrl, "ns=4;s=ResultsForPc_ActivationMilliseconds_0");
_readVariables[2] = new UAReadArguments(_endpointUrl, "ns=4;s=ResultsForPc_ActivationMilliseconds_1");
_readVariables[3] = new UAReadArguments(_endpointUrl, "ns=4;s=ResultsForPc_FiringMillisecond");
_readVariables[4] = new UAReadArguments(_endpointUrl, "ns=4;s=StatusForPc");

Inside a timer, every 10 seconds I read the OPC UA items

UAAttributeDataResult[] attributeDataResultArray = _client.ReadMultiple(_readVariables);

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

More
15 May 2020 06:31 #8485 by support
Hello.

This error is reported by the OPC UA server. It means that the server has not longer resources to open a new session from the client.

This can happen for legitimate reasons (such as if there are truly too many clients at the same time), or under other situations. For example, if the connection between the client and the server breaks, it may take the server some time to recognize the situation, and then even some extra delay, before it releases the session data on its side.

Can you please answer some additional questions?
1. Are you using Live Binding technology of QuickOPC?
2. Are you closing your application regularly, or do you Stop it in Visual Studio? (e.g. when you stop at breakpoint a nd then realize you do not want to go further).
3. Does the application ever crash?

Thank you

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

More
13 May 2020 12:02 #8484 by Sematex
Hello, I'm using the Quick OPC UA library to implement a graphical interface in Visual Studio.

My communication is with a Schneider Electric PLC, model TM241.

For some reason I didn't find out, I can open and close my application three times before the error appears: "BadTooManySessions". Some buttons do this too sometimes.

After this error, only restarting the PLC will it disappear.

Has anyone ever experienced this? Can you give me a light on the solution?

Thank you!
Attachments:

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

Moderators: support
Time to create page: 0.064 seconds