Communicating with a DLL under Linux

M

Mikael Olofsson

I am interested in peoples experience with communicating with DLLs under
Linux.

Situation:

I'm an electrical engineer that finds pleasure in using my soldering
iron from time to time. I also find programming, preferably in Python,
entertaining. I wouldn't call myself a programmer, though. Now, I may
have found a hobby project that could give me the pleasure from both
those worlds. There's this USB development gadget for sale in my
favourite electronics store, and I sure would like to have something
like that connected to my lab computer (a fairly new budget computer
running Kubuntu 6.06).

The gadget costs about 50 Euros. It's not a lot of money, but I would
not like to buy the thing if there is a substancial risk that I will not
be able to make it work on that computer. From what I've read on the
box, it assumes Windows (a number of versions), it includes a DLL to
communicate with it, and example code in VB (iirc). For the interested,
here's the gadget:

http://www.elfa.se/elfa-bin/dyndok.pl?lang=en&vat=0&dok=9001.htm

I have been looking at ctypes, and from what I read, I should be able to
communicate with a DLL by using ctypes. It even sounds fairly easy, as
long as I know what the DLL is supposed to do. I expect there to be some
kind of manual for the DLL included in the box. Are DLLs universal, or
are there different DLLs for Windows and Linux (I'm not a programmer,
remember)? If the vendor claims that the DLL is for Windows, is it
reasonable to assume that it can be made to work under Linux, from
Python, that is? Or is this perhaps completely out of the question?

So, who is willing share their experiences? Share advice? Is this as
easy as it sounds to me? Any pitfalls around?

Regards
/MiO
 
G

Grant Edwards

The gadget costs about 50 Euros. It's not a lot of money, but I would
not like to buy the thing if there is a substancial risk that I will not
be able to make it work on that computer. From what I've read on the
box, it assumes Windows (a number of versions), it includes a DLL to
communicate with it, and example code in VB (iirc). For the interested,
here's the gadget:

http://www.elfa.se/elfa-bin/dyndok.pl?lang=en&vat=0&dok=9001.htm

I have been looking at ctypes, and from what I read, I should be able to
communicate with a DLL by using ctypes.

Only under Windows.
It even sounds fairly easy, as long as I know what the DLL is
supposed to do. I expect there to be some kind of manual for
the DLL included in the box. Are DLLs universal, or are there
different DLLs for Windows and Linux (I'm not a programmer,
remember)?

Yes. Shared libraries (Called DLLs under Windows) are
different than shared libraries under Linux.
If the vendor claims that the DLL is for Windows, is it
reasonable to assume that it can be made to work under Linux
No.

from Python, that is? Or is this perhaps completely out
of the question?

It's probably out of the question.
 
B

Bart Ogryczak

If the vendor claims that the DLL is for Windows, is it
reasonable to assume that it can be made to work under Linux, from
Python, that is?

No. It's reasonable to assume, that there is no *easy* way to get
Win32's DLL working under unices. There are hackish ways, for example
MPlayer does support Win32's DLL codecs.
Linux/Unix shared libraries have completely different file format
(usually ELF).

http://en.wikipedia.org/wiki/Dynamic-link_library
http://en.wikipedia.org/wiki/Executable_and_Linkable_Format
http://en.wikipedia.org/wiki/Shared_library#Naming
 
J

jkn

Hi Mikael
It is probably worth you finding out more about the specific
Hardware that Velleman use for this kit. Depending on the chip
manufacturer, there may be more or less support already available. For
instance, I have recently been communicating with the FTDI USB chips
under windows. There is a PyUSB module which might help you do
something similar, and the FTDI website has quite a lot of
information.

As it turns out, I didn't use PyUSB - for reasons connected with the
version number of Python and annoying things like that (aside - has
anyone got PyUSB compiled for 2.5?). I developed my own pure python
interface to the FTDI chips DLL, using ctypes. So yes, this can be
done. I think you'd be on quite a learning curve for this, from what
you say, but don't let that put you off! Unfortunately I can't share
my code with you, but just knowing that it can be done is sometimes a
help...

FTDI make some evaluation boards for their USB chips and you might
consider going that route... http://www.ftdichip.com BTW. No
connection, just a customer/developer.

HTH
jon N
 
J

John Nagle

Mikael said:
I am interested in peoples experience with communicating with DLLs under
Linux.

Situation:

I'm an electrical engineer that finds pleasure in using my soldering
iron from time to time. I also find programming, preferably in Python,
entertaining. I wouldn't call myself a programmer, though. Now, I may
have found a hobby project that could give me the pleasure from both
those worlds. There's this USB development gadget for sale in my
favourite electronics store, and I sure would like to have something
like that connected to my lab computer (a fairly new budget computer
running Kubuntu 6.06).

Take a look at Wiring:

http://wiring.org.co/

That's an interface board with considerable onboard processing power
and a whole no-cost development environment that runs under Linux
or Windows. It's intended for artists who want to build projects that need
some computer control.

John Nagle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top