Closed sapdejong closed 3 years ago
Thanks for your report. I think this can be solved by extending the OperationTimeout
, I'll try to add it as an option to the PI.PIServer()
constructor.
@Hugovdberg I was wondering if you could provide some hints or a bit more guidance on this and I can try to add the option myself. I am facing the same issue.
The PIServer
object has an attribute connection
which is an AF.PI.PIServer()
object. This itself has a property ConnectionInfo.OperationTimeOut
which is a System.TimeSpan
object containing the maximum time an operation can take. To override this I think you could do something similar to the following for now:
import PIconnect as PI
from System import TimeSpan
timeout = [
0, # hours
5, # minutes
0, # seconds
]
server_manager = PI.PIServer()
server_manager.connection.ConnectionInfo.OperationTimeOut = TimeSpan(*timeout)
with server_manager as server:
print(server.connection.ConnectionInfo.OperationTimeOut)
To implement this in PIconnect, an extra argument could be added to the PIserver.__init__
method to which sets the property on initialisation. This is necessary because once connected (as inside the context manager) the ConnectionInfo is read only.
Description
Tried to get interpolated values for a long period (years) with high interval (minutes). System gives a runetime error
What I Did