Keeping connection open vs opening and closing connection when reading values periodically #1421
-
Hi, I'm currently developing a program that reads data from a PLC through OPC periodically (every 5-10 seconds) and sends it to the cloud. The process is supposed to keep running all day. I was wondering if it's better practice to open the OPC connection, read the values and close the connection once the program ends, or open the connection to read the value, close the connection and then open it again after 5-10 seconds when I need to read the value again. Opening/closing connection once per session or opening/closing connection once per data read (5-10 seconds)? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
keep the connection open! we currently cant reuse the session... so each connect is a new session in the plc and depending on the session timout it can lead to DoS (session exhaustion) of the OPC UA Server. |
Beta Was this translation helpful? Give feedback.
-
@AndreasHeine do we have any issues with sessions staying alive on server? as far as I know we send a request to server to close session. So having sessions left on server should only happen if there is a crash or network issue |
Beta Was this translation helpful? Give feedback.
keep the connection open! we currently cant reuse the session... so each connect is a new session in the plc and depending on the session timout it can lead to DoS (session exhaustion) of the OPC UA Server.