Service clearDiagnosticInformation not fully implemented?

A free API for the communication with control devices according to UDS (ISO 14229-1)
Post Reply
ValeV

Service clearDiagnosticInformation not fully implemented?

Post by ValeV » Mon 21. Oct 2019, 12:29

Hi,

UDS standard specifies request message for service clearDiagnosticInformation as such:

1B SID
3B DTC
1B memory selection

In Peak's implementation function UDS_SvcClearDiagnosticInformation() accepts only canChannel, MessageBuffer and groupOfDTC, but no memory selection parameter (last byte).

Why is that so?
How should I implement my own clearDiagnosticInformation(), that will accept memory selection parameter as well?

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: Service clearDiagnosticInformation not fully implemented

Post by F.Vergnaud » Mon 21. Oct 2019, 13:39

Dear ValeV,

PCAN-UDS implements ISO 14229-1:2006 which doesn't mention any "memory selection" parameter for ClearDiagnosticInformation service. Unfortunately it is neither referenced in the 2013 revision...
Which version of the standard do you refer to?

If you want to write a customized request, simply use the UDS_Write function.
Here is a sample (based on example "PCUClient" project) on how to do so:

Code: Select all

// Sample to request non standard UDS Service
void testCustomService(TPUDSCANHandle Channel, TPUDSNetAddrInfo N_AI)
{
	TPUDSStatus Status;
	TPUDSMsg Message = {};
	TPUDSMsg MessageResponse = {};
	// initialization
	Message.NETADDRINFO = N_AI;

	CLEAR_CONSOLE
		printf("\n\n*** UDS Service: Custom***\n");

	// Sends a Physical Custom Message
	printf("\n\nSends a Physical Custom Message: \n");

	// Initialize message's DATA
	memset(Message.DATA.RAW, 0, sizeof(Message.DATA));
	Message.LEN = 4;
	Message.DATA.REQUEST.SI = 0x18;	
	Message.DATA.REQUEST.PARAM[0] = 0xFF;
	Message.DATA.REQUEST.PARAM[1] = 0xAA;
	Message.DATA.REQUEST.PARAM[2] = 0xBB;
	// Transmit message
	Status = UDS_Write(Channel, &Message);
	if (Status == PUDS_ERROR_OK)
		Status = UDS_WaitForService(Channel, &MessageResponse, &Message);
	printf("  UDS_Write: %i\n", (int)Status);
	if (Status == PUDS_ERROR_OK)
		displayMessage(&Message, &MessageResponse);
	else
		displayMessage(&Message, NULL);
	waitGetch();
}
Best regards,
Fabrice

ValeV

Re: Service clearDiagnosticInformation not fully implemented

Post by ValeV » Mon 21. Oct 2019, 14:33

F.Vergnaud wrote:Dear ValeV,

If you want to write a customized request, simply use the UDS_Write function.
Here is a sample (based on example "PCUClient" project) on how to do so:

Code: Select all

// Sample to request non standard UDS Service
void testCustomService(TPUDSCANHandle Channel, TPUDSNetAddrInfo N_AI)
{
	TPUDSStatus Status;
	TPUDSMsg Message = {};
	TPUDSMsg MessageResponse = {};
	// initialization
	Message.NETADDRINFO = N_AI;

	CLEAR_CONSOLE
		printf("\n\n*** UDS Service: Custom***\n");

	// Sends a Physical Custom Message
	printf("\n\nSends a Physical Custom Message: \n");

	// Initialize message's DATA
	memset(Message.DATA.RAW, 0, sizeof(Message.DATA));
	Message.LEN = 4;
	Message.DATA.REQUEST.SI = 0x18;	
	Message.DATA.REQUEST.PARAM[0] = 0xFF;
	Message.DATA.REQUEST.PARAM[1] = 0xAA;
	Message.DATA.REQUEST.PARAM[2] = 0xBB;
	// Transmit message
	Status = UDS_Write(Channel, &Message);
	if (Status == PUDS_ERROR_OK)
		Status = UDS_WaitForService(Channel, &MessageResponse, &Message);
	printf("  UDS_Write: %i\n", (int)Status);
	if (Status == PUDS_ERROR_OK)
		displayMessage(&Message, &MessageResponse);
	else
		displayMessage(&Message, NULL);
	waitGetch();
}

Thank you for the code, a variation of it works as I wanted.

Post Reply