Is it possible to add to the commands?
For instance if i'm trying to connect to a specific loader using the connect command with a key in bytes 3-8 similar to:
01 00 23 58 D2 22 90 99
How would I go about building this message using your C# CCP API?
Thanks
C# CCP Connect with Key
Re: C# CCP Connect with Key
Hello,
This information is passed to the PCAN-CCP Api using a structure defined for it. The Api comes together with sample code in different programming languages, one of them is C#. Please look at it for more information.
This information is passed to the PCAN-CCP Api using a structure defined for it. The Api comes together with sample code in different programming languages, one of them is C#. Please look at it for more information.
Best regards,
Keneth
Keneth
Re: C# CCP Connect with Key
Hi there,
Thanks for the quick reply.
I have reviewed the included C# materials in great detail but I am still missing something then. With the following code:
CCPResult result = new CCPResult(CCPApi.Connect(m_Channel, ref m_SlaveData, out m_PccpHandle, 1000));
Connect is merely looking for:
[DllImport("PCCP.dll", EntryPoint = "CCP_Connect")]
public static extern TCCPResult Connect(
[MarshalAs(UnmanagedType.U1)]
TPCANHandle Channel,
ref TCCPSlaveData SlaveData,
out TCCPHandle CcpHandle,
ushort TimeOut);
the CCPApi command constructors do not include a "Data" field to include additional data - so I can only assume that the first 3 data bytes matter (Command Code, Command Counter, Station Address) and the remaining cannot be edited.
If i'm mistaken I would love help understanding how to do this.
Thanks for the quick reply.
I have reviewed the included C# materials in great detail but I am still missing something then. With the following code:
CCPResult result = new CCPResult(CCPApi.Connect(m_Channel, ref m_SlaveData, out m_PccpHandle, 1000));
Connect is merely looking for:
[DllImport("PCCP.dll", EntryPoint = "CCP_Connect")]
public static extern TCCPResult Connect(
[MarshalAs(UnmanagedType.U1)]
TPCANHandle Channel,
ref TCCPSlaveData SlaveData,
out TCCPHandle CcpHandle,
ushort TimeOut);
the CCPApi command constructors do not include a "Data" field to include additional data - so I can only assume that the first 3 data bytes matter (Command Code, Command Counter, Station Address) and the remaining cannot be edited.
If i'm mistaken I would love help understanding how to do this.
Re: C# CCP Connect with Key
OK, now I understand what you mind. First of all, each function of CCP represents each CCP Command. For this, CCP commands are sent automatically. Here the introduction Text of the companion Help from PCAN-CCP API:
PCAN-CCP Documentation->Introduction->About PCAN-CCP->CCP Commands vs. API Funcitons
From your first example:
PCAN-CCP Documentation->Introduction->About PCAN-CCP->CCP Commands vs. API Funcitons
Code: Select all
Command Transmission:
The CCP API provides one function for each CCP command described within the document “CAN Calibration Protocol Version 2.1” from ASAP. In this way, calling a function causes:
*The sending of the associated command with its parameters, if it has some.
*The synchronnous wait for the DTO (response) to the command sent.
*In case of a positive response, the return of the information associated to that command.
*In case of a negative response, the error code as function returned code.
sammonsd wrote:01 00 23 58 D2 22 90 99
- 01 is automatically sent withint the function command CCP_Connect. 01 --> Command Code CONNECT 0x01
- 00 is internally used, that is, you don't need to pass this neather.00 --> Command Counter = CTR
- 23 58 is the ECU Address which receives the command (included within the TCCPSlaveData structure passed to the CCP_Connect function). 23 58 --> station address
- D2 22 90 99 This is not used. The Specification says: "4...7 bytes don't care"
Best regards,
Keneth
Keneth