python and pl1000.dll

Post general discussions on using our drivers to write your own software here
Post Reply
nickwheeler

python and pl1000.dll

Post by nickwheeler »

Hello I have an interesting problem communicating with the pl1000.dll from python - I can't find a way to obtain the device handle?
a python shell test:-
*** Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on win32. ***
*** Remote Python engine is active ***
>>> import ctypes as ct
>>> pl1000 = ct.windll.LoadLibrary('pl1000')
>>> _pl1000OpenUnit = pl1000.pl1000OpenUnit
>>> _pl1000OpenUnit.restype = ct.c_short
>>> handle=_pl1000OpenUnit()
Traceback (most recent call last):
File "", line 1, in
ValueError: Procedure probably called with not enough arguments (4 bytes missing)
if I set the _pl1000OpenUnit.argtype to ctypes.c_short then it changes the error message to one argument required.
I experimented with everything I can think of for an argument including "None". With VBA I get a handle=16384 so I tried that and 4000 but always an error instead of a return value.
Anyone have a clue as to what I'm doing wrong?
Thanks

Post Reply