0

I am trying to utilize two ixxat devices via python-can to verify throughput on a gateway module but I can't seem to get two interface devices to connect at the same time. One at a time I can get them to connect and send or receive but I get errors trying to use both. I can get both devices to work at the same time via Busmaster, but I need to eventually work this into something more complex than what I present below, but I'm already running into problems. I am using Ixxat USB-to-CAN v2 Compact interfaces. They're on different USB ports on the same windows PC. I would love to have a device with multiple channels but I've only got single channel devices for now.

My physical set up is one device would send messages on the first CAN bus. These get picked up and forwarded by the vehicle gateway to the second CAN bus. On the second CAN bus the receiver interface would read that the message got through and when.

Ixxat1_sender =CAN1=> GatewayDevice =CAN2=> Ixxat2_receiver

In python I have this:

import can
import can.interfaces.ixxat

sendBus = can.interfaces.ixxat.IXXATBus( channel=0, bitrate=500000, UniqueHardwareId="HWXXXXXX" )
recvBus = can.interfaces.ixxat.IXXATBus( channel=0, bitrate=500000, UniqueHardwareId="HWYYYYYY" )

testMsg = can.Message(arbitration_id = 0x123, data=b"\xFF")
sendBus.send(testMsg)
print(recvBus.recv())

However when I try this I get an OS error on setting up the second device.

Exception has occurred: OSError 
exception: access violation reading 0x00....

It seems like it's just not capable of registering two devices but that seems like a pretty basic thing to have. Is there any way to get two hardware devices to work? I'd be up for using a different some other method, but I'm not sure what might support this easily enough. I don't know if this is a limitation of python-can or what the problem might be.

  • I know it is possible to do physically, because I can run CanAnalyser "mini" on one port and a custom application on another port. I have an USB-to-CAN with 2 ports in one. If I however use the commercial CanAnalyser, it grabs both ports, which I assume is because of some bug... – Lundin Jun 27 '22 at 14:16

1 Answers1

0

I have checked this with two connected USB-to-CAN v2 compact (Python 3.10.2, python-can version 4.0.0 installed via pip). Works as expected. Which VCI4 version do you use ?

klob
  • 1
  • 1
  • I think that VCI version may be part of the issue. I am already using python 3.10.0 and python-can 4.0.0. I will have to try VCI 4 tomorrow to confirm, though. That may not be a lasting solution for my particular usage. We utilize 3.5 still due to some legacy dependencies in regular use and so that's what I'm generally running. I don't know why I didn't think to try 4 at least for a one off test. I thought I had seen somewhere in the python-can documentation that called for V3 only but maybe that was something old. – monkeyfett8 Jun 28 '22 at 22:03
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 29 '22 at 04:36