0

I am running a Python script on a Windows 2016 Server that uses the OpenOPC module to connect to an OPC DA Server and write values to a couple of tags. I need this script to execute every 15 min so I have set up a task in task scheduler to execute the script with the highest privileges whether the user is logged in or not. If I RDP connect to the server and run the script manually it works perfectly. However, as soon as I disconnect the script no longer works.

I am running other python scripts, that connect to SQL databases and query information and then save the proccessed information to excel spreadsheets, which continue to work even when I disconnect. It seems that the OpenOPC module cannot run when the user disconnects. I can't understand why this would be an issue. Take note that the VM does not log off or restart.

I tried running the script manually in IDLE while connected and putting it on a loop so that I could start it, disconnect and reconnect to see what happened. I was presented with the following error code:

Traceback (most recent call last):
File "C:\Users\Script.py", line 92, in <module>
main(time, String, opcServer)
File "C:\Users\Script.py", line 34, in main
opc.connect(opcServer)
File "C:\Python27\lib\site-packages\Pyro\core.py", line 381, in __call__
return self.__send(self.__name, args, kwargs)
File "C:\Python27\lib\site-packages\Pyro\core.py", line 456, in _invokePYRO
return self.adapter.remoteInvocation(name, Pyro.constants.RIF_VarargsAndKeywords, vargs, kargs)
File "C:\Python27\lib\site-packages\Pyro\protocol.py", line 497, in remoteInvocation
return self._remoteInvocation(method, flags, *args)
File "C:\Python27\lib\site-packages\Pyro\protocol.py", line 572, in _remoteInvocation
answer.raiseEx()
File "C:\Python27\lib\site-packages\Pyro\errors.py", line 72, in raiseEx
raise self.excObj
OPCError: Connect: The server process could not be started because the configured identity is incorrect. Check the username and password. (The server process could not be started because the configured identity is incorrect. Check the username and password.)

0 Answers0