Ndstopdiagnosticsession, Ndstopdiagnosticsession -68, Before – National Instruments CAN 372139B-01 User Manual

Page 232

Advertising
background image

Chapter 6

Automotive Diagnostic Command Set API for C

Automotive Diagnostic Command Set User Manual

6-68

ni.com

ndStopDiagnosticSession

Purpose

Executes the StopDiagnosticSession service. Returns the ECU to normal mode.

Format

long ndStopDiagnosticSession(

TD1 *diagRef,

LVBoolean *success);

Input

diagRef

Specifies the diagnostic session handle, obtained from

ndOpenDiagnostic

and passed

to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate
the elements of this struct.

Output

success

Indicates successful receipt of a positive response message for this diagnostic service.

Return Value

The return value indicates the function call status as a signed 32-bit integer. Zero means the
function executed successfully. A negative value specifies an error, which means the function
did not perform the expected behavior. A positive value specifies a warning, which means the
function performed as expected, but a condition arose that may require attention.

Use the

ndStatusToString

function to obtain a descriptive string for the return value.

Description

This function disables the current ECU diagnostic mode. A diagnostic session stops only if
communication with the ECU is established and a diagnostic session is running. If no
diagnostic session is running, the default session is active.

ndStopDiagnosticSession

cannot disable the default session. If the ECU stops the current diagnostic session, it performs
the necessary action to restore its normal operating conditions. Restoring the normal ECU
operating conditions may include resetting all controlled actuators activated during the
diagnostic session being stopped, and resuming all normal ECU algorithms. You
should call

ndStopDiagnosticSession

before disabling communication with

ndCloseDiagnostic

, but only if you previously used

ndStartDiagnosticSession

.

Advertising