openopc
openopc copied to clipboard
opc.read() line killing and restating the kernel
I got stuck up with small issue while using openOPC. I have installed python 3.8.3 on windows 10 64 bit system. Installed OpenOPC-Python3x through pip install. Running Matrikon OPC simulation server and OPC explorer for data simulation.
While running the following code, I'm able to connect with Matrikon OPC server, but when I try to read/write the data, kernel is restarting and I'm not able to get any data.
import OpenOPC
opc = OpenOPC.client()
print(opc.servers())
opc.connect('Matrikon.OPC.Simulation.1')
print(opc['Random.Real8'])
opc.close()
Kindly help me to get out of this issue. I also tried with different IDEs (Jupyter, Spyder, IDLE), but same result.
You should use 32 bit version of python. And then you will get another error like this
_pickle.PicklingError: Can't pickle : attribute lookup datetime on pywintypes failed.
This link solves above error.
@qqq89513 Thanks for the reply. I'll try the same.
I suggest closing this issue because @qqq89513 's solution works for me.