Programming PicoVNA without Microsoft Visual Studios

Post general discussions on using our drivers to write your own software here
Post Reply
newuser111
Newbie
Posts: 0
Joined: Thu May 16, 2019 7:10 pm

Programming PicoVNA without Microsoft Visual Studios

Post by newuser111 » Tue Jun 18, 2019 6:06 pm

Hi,

Has anyone successfully communicated with the PicoVNA 106 using python without Microsoft Visual Studios? I first import the 'PicoControl2 Library' (included as the wrapper in https://github.com/picotech/picosdk-picovna-python-examples) but either way I get a communication error.

>>> win32com.client.Dispatch("PicoControl2.PicoVNA_2")
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)

Thanks!

NeilH
PICO STAFF
PICO STAFF
Posts: 181
Joined: Tue Jul 18, 2017 8:28 am

Re: Programming PicoVNA without Microsoft Visual Studios

Post by NeilH » Tue Jul 16, 2019 7:21 am

Hi

The python script should run from outside visual studio. It looks like the PicoControl2.dll isn't registered on your PC, if you have the PicoVNA2 software from our downloads page installed can you open CMD as an administrator by right clicking on it then navigate to C:\Windows\sysWOW64 then run this command;
regsvr32 PicoControl2.dll
This should then stop the error from occurring, when using 32 bit Python.

Neil
Neil
Technical Support Engineer

Post Reply