Hello,
I can receive CAN FD messages using PCAN USB FD with some C++ code using the PCANBasic API on Ubuntu. Now I'm trying to get it working with 2 PCAN USB FD dongles. I've set the device IDs to 13 and 16, respectively, using e.g.
peak-linux-driver-8.5.1/test/pcan-setting -f=/dev/pcanusbfd32 -d=15
My question is, how do I use the device IDs to individually initialize and read CAN messages? For a single device, I use the following to initialize and read
Status = CAN_InitializeFD(PCAN_USBBUS1, bitRate);
Status = CAN_ReadFD(PCAN_USBBUS1, &Message, NULL)
What's the equivalent using Device ID instead of "PCAN_USBBUS1"?
Thanks,
- j
Multiple PCAN USB FD with PCANBasic API for Linux
-
- Posts: 4
- Joined: Sat 16. Dec 2017, 03:46
- S.Grosjean
- Software Development
- Posts: 357
- Joined: Wed 4. Jul 2012, 17:02
Re: Multiple PCAN USB FD with PCANBasic API for Linux
Hi,
There is no "direct" method: your application will have to open each PCAN_USBBUSi and call:
to get each number (see: "PCANBasic_enu.chm" and "PCAN-Parameter_Documentation.pdf" page 11).
Regards,
Stéphane
There is no "direct" method: your application will have to open each PCAN_USBBUSi and call:
Code: Select all
CAN_GetValue(pcanHandle, PCAN_DEVICE_NUMBER, (void*)&iBuffer, sizeof(iBuffer));
Regards,
Stéphane
— Stéphane
-
- Posts: 4
- Joined: Sat 16. Dec 2017, 03:46
Re: Multiple PCAN USB FD with PCANBasic API for Linux
Ah I see. Works for me. Thanks!