Hello,
I purchased the USB/CAN adapter. I have an ECU I am testing. I know it has CCP loaded because of the results in PCAN-View (see attached).
CRO: $18EF02F9, DOT: $18EFF902, ECU Address: $FFFF, Baud Rate: 250K
Using your PCAN-CCP Example written in Delphi I have made the necessary adjustments to the form create (button connect has no adjustments):
procedure TForm1.FormCreate(Sender: TObject);
begin
m_PccpHandle := 0;
m_Channel := TPCANBasic.PCAN_USBBUS1; // PCAN Channel to use
m_Baudrate := PCAN_BAUD_250K;
m_SlaveData.EcuAddress := $FFFF; // ECU Data
m_SlaveData.IdCRO := $18ef02f9;
m_SlaveData.IdDTO := $18eff902;
m_SlaveData.IntelFormat := True;
end;
procedure TForm1.btnConnectClick(Sender: TObject);
var
bConnected: boolean;
ccpResult: TCCPResult;
begin
ccpResult := CCP_Connect(m_Channel, m_SlaveData, m_PccpHandle, 0);
bConnected := ccpResult = CCP_ERROR_ACKNOWLEDGE_OK;
btnConnect.Enabled := (not bConnected);
btnDisconnect.Enabled := bConnected;
btnGetVersion.Enabled := bConnected;
btnExchange.Enabled := bConnected;
btnGetId.Enabled := false;
if (not bConnected) then
if (ccpResult > CCP_ERROR_PCAN) then
ShowMessage(Format('PCAN Error: 0x%X', [(ccpResult and $FFFFFFF)]))
else
ShowMessage(Format('CCP Error: 0x%X', [ccpResult]));
end;
I start the program. The device is recognized. However, when I press "Connect" I get an error:
CCP Error: 0x12
What have I done wrong?
Delphi CCP Problem
Delphi CCP Problem
- Attachments
-
- PCAN-View.jpg (67.56 KiB) Viewed 14176 times
Re: Delphi CCP Problem
Hello tj_40071,
Please check the value of the CRO/DTO Ids you are using. They seem to be Extended-Ids, but their extended bit (Most Significant Bit on each) are not set:
CRO: $18EF02F9 --> $98EF02F9
DTO: $18EFF902 --> $98EFF902
Please check also that you are using the last version of the CCP Api. Here you find information about changes/releases of the PCCP-Api. Using this link you can download the last version 1.0.1.7. Older versions were able to use only one byte for the ECU address (and yours has two, 0xFFFF).
Subscribe to the RSS-Feed to be informed about the latest publications on our website like news, version information, and downloads.
Please check the value of the CRO/DTO Ids you are using. They seem to be Extended-Ids, but their extended bit (Most Significant Bit on each) are not set:
CRO: $18EF02F9 --> $98EF02F9
DTO: $18EFF902 --> $98EFF902
Please check also that you are using the last version of the CCP Api. Here you find information about changes/releases of the PCCP-Api. Using this link you can download the last version 1.0.1.7. Older versions were able to use only one byte for the ECU address (and yours has two, 0xFFFF).
Subscribe to the RSS-Feed to be informed about the latest publications on our website like news, version information, and downloads.
Best regards,
Keneth
Keneth
Re: Delphi CCP Problem
I have progress. Guess I need to add an extended option.
Connect works. Disconnects works. Test states "ECU is available for connect.
What does not work is
1. Get Version error 0x36 (not available)
2. Exchange Ids error 0x32 (param out of range)
3. Get Slave Id is disabled
Using PCAN-View
1. Get Version - I sent a message and it returned FF,00,01,02,01,00,00,00 which is 2.1 which is correct
2. Exchange Ids - I sent a message and it returned FF,32,00,00,41,40,00 which I guess is the same as 0x32.
3. Get Slave Id - Not sure which command to use.
Connect works. Disconnects works. Test states "ECU is available for connect.
What does not work is
1. Get Version error 0x36 (not available)
2. Exchange Ids error 0x32 (param out of range)
3. Get Slave Id is disabled
Using PCAN-View
1. Get Version - I sent a message and it returned FF,00,01,02,01,00,00,00 which is 2.1 which is correct
2. Exchange Ids - I sent a message and it returned FF,32,00,00,41,40,00 which I guess is the same as 0x32.
3. Get Slave Id - Not sure which command to use.
Re: Delphi CCP Problem
Hello tj_40071,
2. The data being sent to the ECU is not OK. Please check the ECU documentation to see what it is expecting.
3. You have to use UPLOAD after successfully calling of EXCHANGE_ID. Please read/get the CCP Documentation if you want to learn more about CCP. The name is "CCP_V2.1.pdf" and can be adquired by http://www.asam.net/.
This error is returned when the ccpHandle passed to the function is invalid. Check what are you passing to the function.tj_40071 wrote:1. Get Version error 0x36 (not available)
This error is returned in two cases: If you try to send more than 6 data bytes within this function, the Api catch this and returns the error 0x32. If the data sent to the ECU is for it to much (configuration dependent), then the ECU returns the error 0x32.tj_40071 wrote:2. Exchange Ids error 0x32 (param out of range)
The command EXCHANGE_ID must be first successfully executed. This returns the length of the ID and sets the Memory Transfer Address 0 to the place from where the ID will be read.tj_40071 wrote:3. Get Slave Id is disabled
1. Please connect the PCAN-View to the same Bus your application is using, so that you can see all messages being sent from your application, i.e. from the CCP Api. If you see no messages when asking for the version, then it means (as explained above) that the handle passed to the function is wrong/corrupt/invalid, or you have disconnected the client at this point.tj_40071 wrote:Using PCAN-View
1. Get Version - I sent a message and it returned FF,00,01,02,01,00,00,00 which is 2.1 which is correct
2. Exchange Ids - I sent a message and it returned FF,32,00,00,41,40,00 which I guess is the same as 0x32.
3. Get Slave Id - Not sure which command to use
2. The data being sent to the ECU is not OK. Please check the ECU documentation to see what it is expecting.
3. You have to use UPLOAD after successfully calling of EXCHANGE_ID. Please read/get the CCP Documentation if you want to learn more about CCP. The name is "CCP_V2.1.pdf" and can be adquired by http://www.asam.net/.
Best regards,
Keneth
Keneth
Re: Delphi CCP Problem
I was talking about your sample Delphi program. I changed no code for those functions that failed.
The only code that I changed was in the form create that I stated earlier.
The only code that I changed was in the form create that I stated earlier.
Re: Delphi CCP Problem
Hello,
I have just tested the Delphi demo project and I cannot get such an error as you described. Please check your ECU configuration. I have recorded a trace while I tested the project. The following picture shows pairs of CROs and DTOs. Please compare these with those of your ECU:
As you, I only changed the data within the FormCreate procedure:
I have just tested the Delphi demo project and I cannot get such an error as you described. Please check your ECU configuration. I have recorded a trace while I tested the project. The following picture shows pairs of CROs and DTOs. Please compare these with those of your ECU:
As you, I only changed the data within the FormCreate procedure:
If the problem persists, please try to record a trace as I did, so that we can interpret the data and see why this is happening.// PCAN Channel to use
//
m_Channel := TPCANBasic.PCAN_USBBUS1;
m_Baudrate := PCAN_BAUD_250K;
// ECU Data
//
m_SlaveData.EcuAddress := $FFFF;
m_SlaveData.IdCRO := $98EF02F9;
m_SlaveData.IdDTO := $98EFF902;
m_SlaveData.IntelFormat := True;
Best regards,
Keneth
Keneth