ya-mouse / openopc

OpenOPC for Python3.4
Other
48 stars 56 forks source link

'Matrikon.OPC.Automation' - Dispatch: Class not registered #22

Closed jamesbraza closed 1 year ago

jamesbraza commented 1 year ago

I am trying to complete the steps in https://openopc.sourceforge.net/'s minimal working program example, and have begun by using src/opc.py to scan for OPC servers:

> python -m src.opc -q
Failed to initialize an OPC Automation Class from the search list 'Matrikon.OPC.Automation' - Dispatch: Class not registered

Any ideas on how to fix this?

I am using Python 3.10.8 on Windows 10 with the below pip packages:

Pyro4==4.82
pywin32==305
jamesbraza commented 1 year ago

Well, per this random forum post from 2014: https://sourceforge.net/p/openopc/discussion/709251/thread/189aae61/#7bd0

I discovered having 32-bit vs 64-bit Python matters 😿. I installed 32-bit Python using pyenv-win:

> pyenv install 3.10.9-win32
> pyenv local 3.10.9-win32
> python -m venv venv
> .\venv\Scripts\activate
> python -m pip install -e . pywin32

And installing and opening MatrikonOPC Simulation Server, it works:

> python -m src.opc -q
Matrikon.OPC.Simulation.1
> python -m src.opc -r Random.Bool
Random.Bool     41.0000     Good     2023-01-04 15:03:54.042000+00:00

Read 1 of 1 items (0.08 seconds)