Access to CAN-Bus
eliben
eliben at gmail.com
Mon Jun 9 07:06:54 EDT 2008
On Jun 9, 8:57 am, Thin Myrna <no.s... at spam.no> wrote:
> I'd like to access some drive hardware via CAN bus from Python under Linux
> (sending rec'ing PDOs). Googling around I couldn't find a Python package,
> but people who said that they are doing this, though. I guess they are
> using their home brewn software.
>
> Any pointer to
> - such software (anyone willing to share his experience?)
> - how to write such software?
>
> Under Windows, I guess, I could use some COM or ctypes functionality to
> access the hardware vendor's hardware. What if I wanted to access such
> hardware from Linux? Is there a package that allows that in a vendor (who
> doesn't support Linux) independent way?
>
> Many thanks in advance
> Thin
I don't think this can be done in a vendor independent way, because as
far as I know there is no standard for CAN drivers. It all depends on
the card you have and what its maker supplies.
It usually works as follows: the car maker supplies a DLL file with
some examples of calling it from C or Visual Basic (for Windows
systems). Maybe the DLL is downloadable from the company's website.
You can easily ruse this DLL from Python, with the excellent 'ctypes'
module. I've had some dealings with DLLs from various scripting
languages, and I can tell you with confidence that nothing comes close
to the ease of use and functionality of ctypes.
More information about the Python-list
mailing list