python-can icon indicating copy to clipboard operation
python-can copied to clipboard

Vector CANoe Virtual Channel

Open Matthis-wilh opened this issue 5 years ago • 5 comments

Hi, I´ve got a question / issue? I use python-can with Vector CANoe to log the CAN Data and use it in python. When I´m using a real CAN-Interface (VN1610), I can view the traffic with the can.viewer. How ever I´m not able to configure the pyhton-can can.viewer to show me messages send on the virtual can channel of CANoe with the interface not connected. When I start the can.viewer the CANalyzer is shown as active in the hardware config, but CANoe isn´t shown as active during the measurement, even if the CANoe trace window shows that messages are sent.

Is this caused by python-can or by CANoe not supporting "virtual can"?

Here´s my hardware config from CANoe image

Matthis-wilh avatar Jul 01 '20 07:07 Matthis-wilh

How do you start can.viewer?

christiansandberg avatar Jul 01 '20 14:07 christiansandberg

python -m can.viewer -i vector -c 0,1

Matthis-wilh avatar Jul 01 '20 14:07 Matthis-wilh

Vector Virtual CAN is supported. Can you send frames from python-can (i.e. using can.player) and see the frames in can.viewer running in another process?

pierreluctg avatar Jul 02 '20 20:07 pierreluctg

Yes. I started can.viewer in a seperate window with the options mentioned in my last comment and then run the following python script: import can bus = can.interface.Bus(bustype='vector', channel=0, bitrate=250000) msg = can.Message(arbitration_id=0xa2, data=[1, 2, 3, 4, 5, 6, 7, 8], extended_id=False) bus.send(msg)

The viewer shows the message. I´m believe the issue is caused by CANoe. Unfortunately I´m pretty new to CANoe so I´ve no idea whats the problem.

Matthis-wilh avatar Jul 03 '20 12:07 Matthis-wilh

As I know when you saw one of channel is acvtive, it means you're running CANOE/CANAPE or CANalyzer and those software occpied virtual channel already. Note: Vector product allows multi application to control their device at the same time.

As you know PythonCAN support virtual channel, you could simulate it to test. PythonCAN-->Virtual Channel 1 --> use logger mode to listen message. CANOE/CANAPE or CANalyzer --> Virtual Channel 1 --> Send message.

FredericChang avatar May 21 '21 20:05 FredericChang