16. cc_vector_can
16.1. CAN Communication Channel using Vector hardware
- module:
cc_vector_can
- synopsis:
CChannel implementation for CAN(fd) using Vector API from python-can
- class pykiso.lib.connectors.cc_vector_can.CCVectorCan(bustype='vector', poll_interval=0.01, rx_queue_size=524288, serial=None, channel=3, bitrate=500000, data_bitrate=2000000, fd=True, enable_brs=False, app_name=None, can_filters=None, is_extended_id=False, **kwargs)[source]
CAN FD channel-adapter.
Initialize can channel settings.
- Parameters:
bustype (
str
) – python-can interface modules usedpoll_interval (
float
) – Poll interval in seconds.rx_queue_size (
int
) – Number of messages in receive queueserial (
int
) – Vector Box’s serial number. Can be replaced by the “AUTO” flag to trigger the Vector Box automatic detection.channel (
int
) – The channel indexes to create this bus withbitrate (
int
) – Bitrate in bits/s.app_name (
str
) – Name of application in Hardware Config. If set to None, the channel should be a global channel index.data_bitrate (
int
) – Which bitrate to use for data phase in CAN FD.fd (
bool
) – If CAN-FD frames should be supported.enable_brs (
bool
) – sets the bitrate_switch flag to use higher transmission speedcan_filters (
list
) – A iterable of dictionaries each containing a “can_id”, a “can_mask”, and an optional “extended” key.is_extended_id (
bool
) – This flag controls the size of the arbitration_id field.
- pykiso.lib.connectors.cc_vector_can.detect_serial_number()[source]
Provide the serial number of the currently available Vector Box to be used.
If several Vector Boxes are detected, the one with the lowest serial number is selected. If no Vector Box is connected, a ConnectionRefused error is thrown.
- Return type:
int
- Returns:
the Vector Box serial number
- Raises:
ConnectionRefusedError – raised if no Vector box is currently available