PCAN Basic API¶
Warning
This PCAN
documentation is a work in progress. Feedback and revisions are most welcome!
Interface to Peak-System’s PCAN-Basic API.
Configuration¶
An example can.ini file for windows 7:
[default]
interface = pcan
channel = PCAN_USBBUS1
Bus¶
-
class
can.interfaces.pcan.
PcanBus
(channel, state=<property object>, *args, **kwargs)[source]¶ Bases:
can.bus.BusABC
A PCAN USB interface to CAN.
On top of the usual
Bus
methods provided, the PCAN interface includes theflash()
andstatus()
methods.Parameters: -
flash
(flash)[source]¶ Turn on or off flashing of the device’s LED for physical identification purposes.
-
send
(msg, timeout=None)[source]¶ Transmit a message to the CAN bus.
Override this method to enable the transmit path.
Parameters: - msg (can.Message) – A message object.
- timeout (float) – If > 0, wait up to this many seconds for message to be ACK:ed or for transmit queue to be ready depending on driver implementation. If timeout is exceeded, an exception will be raised. Might not be supported by all interfaces.
Raises: can.CanError – if the message could not be written.
-
shutdown
()[source]¶ Called to carry out any interface specific cleanup required in shutting down a bus.
-