Purpose

Initiates an upload of data from the ECU.

Format

        long ndUDSRequestUpload (
       TD1 *diagRef,
       unsigned long memoryAddress,
       unsigned long memorySize,
       unsigned char memoryAddressLength,
       unsigned char memorySizeLength,
       unsigned char dataFormatIdentifier,
       unsigned long *blockSize,
       LVBoolean *success);
      

Input

diagRef

Specifies the diagnostic session handle, obtained from ndOpenDiagnosticOnCANFD or ndOpenDiagnosticOnIPStack and passed to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate the elements of this struct.

memoryAddress

Defines the memory address from which data are to be read.

memorySize

Defines the size of the data to be read.

memoryAddressLength

Defines the number of bytes of the memoryAddress parameter that are written to the ECU. This value is implementation dependent and must be in the range of 1–4. For example, if this value is 2, only the two lowest bytes of the address are written to the ECU.

memorySizeLength

Defines the number of bytes of the memorySize parameter that are written to the ECU. This value is implementation dependent and must be in the range of 1–4. For example, if this value is 2, only the two lowest bytes of the size are written to the ECU.

dataFormatIdentifier

Defines the compression and encryption scheme used for the data blocks written to the ECU. A value of 0 means no compression/no encryption. Nonzero values are not standardized and implementation dependent. Output

blockSize

Returns the number of data bytes to be transferred from the ECU in subsequent ndUDSTransferData requests.

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

ndUDSRequestUpload initiates the upload of a data block from the ECU. This is required to set up the upload process; the actual data transfer occurs with subsequent ndUDSTransferData requests. The transfer must occur in blocks of the size that this service returns (the blockSize parameter). After the download completes, use the ndUDSRequestTransferExit service to terminate the process.