Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on July 21, 2021, 04:50:31 PM

Title: BRX stops responding to MTCP client
Post by: Controls Guy on July 21, 2021, 04:50:31 PM
It's the week of nonsense problems!  ???  Had a BRX suddenly stop accepting MTCP writes today, but still talks to other MTCP clients, and will even talk to those same nodes for DMD

System:

History and current observations:

So the BRX seems to be not accepting Modbus writes, but only selectively; HMI still writes, reads, everything.

ModbusTCPServer.Transactions is incrementing wildly, but the HMI polls pretty fast.   .Errors and .LastError both at 0.    Any ideas or anything else to check?   I proposed temporarily disconnecting the HMI but with the client PC not able to send jobs, the HMI is the only safety net, so they don't want to disconnect it, even temporarily.

Title: Re: BRX stops responding to MTCP client
Post by: BobO on July 21, 2021, 08:01:18 PM
Looks weird to me. Filter your trace on the two relevant IP addresses and port 502. There isn't really much Modbus traffic, but the thing that stands out is the client opens a connection to the server and then immediately opens another one, and then sends a Modbus request on the second one. The PLC seems a bit put out with it and closes the first and then second socket. If the client is doing this often, you are probably burning up your concurrent sessions. Check the server structure to see how many sessions are active.
Title: Re: BRX stops responding to MTCP client
Post by: Controls Guy on July 21, 2021, 09:05:23 PM
OK, will check it in the morning.   Thank you!
Title: Re: BRX stops responding to MTCP client
Post by: Controls Guy on July 22, 2021, 12:08:15 PM
Yup, active sessions is maxed out (at 10)

What terminates sessions?   I'd think one thing would be the timeout in the MTCP config, but I seriously doubt they're using 9 sessions regularly.

Title: Re: BRX stops responding to MTCP client
Post by: BobO on July 22, 2021, 12:18:31 PM
Yup, active sessions is maxed out (at 10)

What terminates sessions?   I'd think one thing would be the timeout in the MTCP config, but I seriously doubt they're using 9 sessions regularly.

The answer to your question is the Inactivity Timeout. The PLC shuts down any session after the server has gone silent (on that connection) for that period of time.

Your client created two sessions back to back without even using the first one. While I have no proof of it, I assume that wasn't the first time it did it, and if it is doing it often enough, there may not be enough sessions ever. Ideally clients open connections and then keep using them without closing and reopening. I think if the session is closed normally we'll free it up immediately, but if it creating two rapidly without sending a request, that would fall to the inactivity timeout to clear. If the timeout is long enough and the new sessions are created often enough, you'll run out.

Title: Re: BRX stops responding to MTCP client
Post by: Controls Guy on July 22, 2021, 12:26:05 PM
OK, changed timeout from 60 to 5 seconds and sessions from 10 to the max of 16.    Should work now, so I'll watch the active session count while they run and see what it does.

I might get a job/recipe request from them say every 30 seconds or so, so if I make the timeout less than that, will it cause problems for the client, not having an open connection the next time they want to use it?   Will it typically just loop back and open a new one (which will now be OK, since we're aggressively closing unused ones).
Title: Re: BRX stops responding to MTCP client
Post by: BobO on July 22, 2021, 12:38:38 PM
OK, changed timeout from 60 to 5 seconds and sessions from 10 to the max of 16.    Should work now, so I'll watch the active session count while they run and see what it does.

I might get a job/recipe request from them say every 30 seconds or so, so if I make the timeout less than that, will it cause problems for the client, not having an open connection the next time they want to use it?   Will it typically just loop back and open a new one (which will now be OK, since we're aggressively closing unused ones).

No clue what the client will do, but since it was the connection-happy one causing the issue, I assume it will keep at it until it's happy.
Title: Re: BRX stops responding to MTCP client
Post by: Controls Guy on July 22, 2021, 12:48:10 PM
No clue what the client will do, but since it was the connection-happy one causing the issue, I assume it will keep at it until it's happy.

That's my suspicion as well.  Customer is in contact with the mfgr tech support so we may get an answer.