Delphi CCP Problem
Posted: Wed 5. Sep 2012, 18:15
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?
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?