PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
Hello,
I am trying to receive frames from my PEAK USB CAN FD Hardware. I have built the C++ program using some examples as well as PCANBasic API.
However I obtain the ERROR code 7168 (1C00 hex) as a return of the function "CAN_ReadFD". I´ve read on Internet that it could be caused because I´m not using the correct FD channel, but I´ve tried with each one of the 16 avaiable.
Is there any other thing which can cause this error code (PCAN_ERROR_ILLCLIENT)?
Thank you for your help!!
I am trying to receive frames from my PEAK USB CAN FD Hardware. I have built the C++ program using some examples as well as PCANBasic API.
However I obtain the ERROR code 7168 (1C00 hex) as a return of the function "CAN_ReadFD". I´ve read on Internet that it could be caused because I´m not using the correct FD channel, but I´ve tried with each one of the 16 avaiable.
Is there any other thing which can cause this error code (PCAN_ERROR_ILLCLIENT)?
Thank you for your help!!
Re: PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
Hello again,
I update info. I have solved finally this error, and now I recognize the hardware.. OKEY
The error have turned into "PCAN_ERROR_INITIALIZE". That means that when I try to use the CAN FD Channel, it is already in use so I have to Uninitialize it but the error continues... The strucutre I am using now on the C++ code in:
VARIABLE DECLARATIONS
MAIN FUNCTION ()
- Initialize channel
- TPCAN Status=CAN_ReadFD
- Uninitialize channel
Thank again
I update info. I have solved finally this error, and now I recognize the hardware.. OKEY
The error have turned into "PCAN_ERROR_INITIALIZE". That means that when I try to use the CAN FD Channel, it is already in use so I have to Uninitialize it but the error continues... The strucutre I am using now on the C++ code in:
VARIABLE DECLARATIONS
MAIN FUNCTION ()
- Initialize channel
- TPCAN Status=CAN_ReadFD
- Uninitialize channel
Thank again
Re: PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
Hello,
yes, you need to first initialize a channel to be able to read. And yes, you need to uninitialize it to be able to initialize it from andere applicaitons or with different configuration (CAN vs CAN-FD for instance). This information can be read in the help file, chapter "Introduction/Understanding PCAN-Basic).
Please check the help and the example prokjects. There is all what you need to write your own application.
yes, you need to first initialize a channel to be able to read. And yes, you need to uninitialize it to be able to initialize it from andere applicaitons or with different configuration (CAN vs CAN-FD for instance). This information can be read in the help file, chapter "Introduction/Understanding PCAN-Basic).
Please check the help and the example prokjects. There is all what you need to write your own application.
- Attachments
-
- PCB_Help.PNG (60.86 KiB) Viewed 2011 times
Best regards,
Keneth
Keneth
Re: PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
Hi,
Thank you for your quick response..
Yes, I know that, I follow that steps but the return that "CAN_Uninitialize" gives me it´s PCAN_ERROR_INITIALIZE (see screenshot error).
It´s like the code does not recognize the hardware, am i true??
Gretings
Thank you for your quick response..
Yes, I know that, I follow that steps but the return that "CAN_Uninitialize" gives me it´s PCAN_ERROR_INITIALIZE (see screenshot error).
It´s like the code does not recognize the hardware, am i true??
Gretings
- Attachments
-
- PCAN_ERROR_INITIALIZE
- Error.JPG (16.49 KiB) Viewed 2006 times
Re: PCANBasic. C++. CAN FD. PCAN_ERROR_ILLCLIENT
Hello,
as the help states, ERROR_INITIALIZE is only returned, if the channel passed was not initialized first. Probably you are either calling the funciton twice, or you are using different channel values for CAN_Initialize and CAN_Uninitialize.
You can call CAN_Uninitialize using the channel PCAN_NONEBUS, which causes de uninitialization of all initialized channel by the application, but I recommend to debug and cehck the channel value used in both functions.
If still no luck, please post here the code used for initialize and uninitialize the channel.
as the help states, ERROR_INITIALIZE is only returned, if the channel passed was not initialized first. Probably you are either calling the funciton twice, or you are using different channel values for CAN_Initialize and CAN_Uninitialize.
You can call CAN_Uninitialize using the channel PCAN_NONEBUS, which causes de uninitialization of all initialized channel by the application, but I recommend to debug and cehck the channel value used in both functions.
If still no luck, please post here the code used for initialize and uninitialize the channel.
Best regards,
Keneth
Keneth