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.