I'm writing my own application in a linux computer running Ubuntu 18.04.5 64-Bit.
I have today downloaded latest driver and api from Peak-Systems online DVD.
Interface driver 1.4.6
Peak linux driver 8.10.2
Interface typ PCAN-USB IPEH-002021-303018
I can read and write data to the can-bus. No problems.
But I cannot use the SetValue & GetValue functions.
Well I can read and get a value. But cannot modify the value.
Example:
Code: Select all
int fd;
Status = CAN_Initialize(PCAN_USBBUS1, PCAN_BAUD_500K, 0, 0, 0);
printf("CAN_Initialize(%xh): Status=0x%x\n", pcan_device, (int)Status);
if (Status)
goto lbl_exit;
fd=2;
Status = CAN_SetValue(PCAN_USBBUS1, PCAN_DEVICE_NUMBER, &fd, sizeof fd);
printf("PCAN_DEVICE_NUMBER %d - Status=0x%x\n",fd, (int)Status);
sleep(5);
fd=0;
Status = CAN_GetValue(PCAN_USBBUS1, PCAN_DEVICE_NUMBER, &fd, sizeof fd);
printf("PCAN_DEVICE_NUMBER %d - Status=0x%x\n",fd, (int)Status);
Will output:
Code: Select all
CAN_Initialize(51h): Status=0x0
PCAN_DEVICE_NUMBER 2 - Status=0x0
Error unhandled errno (19 / 0x13)
.PCAN_DEVICE_NUMBER 0 - Status=0x10000
Even the PCAN_CHANNEL_IDENTIFYING fails. No blinking except the normal flashing when communicating.
(Expect fast blinking during identification.)
I have probably done something wrong. Please help me.
I need to set some kind of ID on every PCAN-USB adapter to be able to know who is who.
/T.