ndDiagGetProperty
- Updated2025-10-07
- 5 minute(s) read
Purpose
Gets a diagnostic global internal parameter.
Format
int32_t ndDiagGetProperty(
TD1 *diagRef,
uint16_t propertyID,
uint32_t *propertyValue);
Input
diagRef
Specifies the handle for the diagnostic session, obtained from ndOpenDiagnosticOnIPStack and passed to subsequent diagnostic functions. Normally, it is not necessary to manually manipulate the elements of this struct.
propertyID
Defines the parameter whose value is to be retrieved:
| 0 | Timeout Diag Command is the timeout in milliseconds the master waits for the response to or DoIP acknowledgement of a diagnostic request message. The default is 1000Â ms. This is the P2 timeout from the ISO 15765-3 specification. | ||||||||
| 1 | Timeout FC (Bs) is the timeout in milliseconds the master waits for a Flow Control frame after sending a First Frame or the last Consecutive Frame of a block. The default is 250Â ms. | ||||||||
| 2 | Timeout CF (Cr) is the timeout in milliseconds the master waits for a Consecutive Frame in a multiframe response. The default is 250Â ms for CAN and 1000 ms for LIN. | ||||||||
| 3 | Receive Block Size (BS) is the number of Consecutive Frames the slave sends in one block before waiting for the next Flow Control frame. A value of 0 (default) means all Consecutive Frames are sent in one run without interruption. | ||||||||
| 4 | Wait Time CF (STmin) defines the minimum time for the slave to wait between sending two Consecutive Frames of a block. Values from 0 to 127 are wait times in milliseconds. Values 241 to 249 (Hex F1 to F9) mean wait times of 100 µs to 900 µs, respectively. All other values are reserved. The default is 5 ms. | ||||||||
| 5 | Max Wait Frames (N_WFTmax) is the maximum number of WAIT frames the master accepts before terminating the connection. The default is 10. | ||||||||
| 6 | Wait Frames to Send (N_WAIT) is the number of WAIT frames the master sends every time before a CTS frame is sent. If you set this value to a negative number (for example, 0xFFFFFFFF = –1), the master sends an OVERLOAD frame instead of a WAIT, and reception is aborted. The default is 0 for maximum speed. | ||||||||
| 7 | Time between Waits (T_W) is the number of milliseconds the master waits after sending a WAIT frame. The default is 25. | ||||||||
| 8 | Fill CAN Frames returns whether ISO-TP CAN frames are padded.
|
||||||||
| 9 | Fill Byte returns the CAN frame content if filled with defined data or random data bytes.
The default is 255 (0xFF). |
||||||||
| 10 | Invalid Response as Error returns how the toolkit handles an invalid ECU response.
|
||||||||
| 11 | Max RspPending Count is the number of times a ReqCorrectlyRcvd-RspPending (0x78) Negative Response Message will be accepted to extend the command timeout (default 5). If this message is sent more often in response to a request, an error –8120 is returned. If the ECU implements commands with a long duration (for example, flash commands), you may need to extend this number. | ||||||||
| 12 | VWTP Command Time Out is the time in milliseconds the host waits for a VWTP 2.0 command to be executed (default 50 ms). The specification states this as 50 ms plus the network latency, but some ECUs may require higher values. | ||||||||
| 13 | STmin is the minimum time in seconds between the end of transmission of a frame in a diagnostic request message and the start of transmission of the next frame in the diagnostic request message for LIN-based diagnostic communication. The default is 0. | ||||||||
| 14 | P2min is the minimum time in seconds between reception of the last frame of the diagnostic request and the response sent by the node for LIN-based diagnostic communication. The default is 0.05. | ||||||||
| 15 | Termination reads the NI-XNET Termination property. Reflections on the CAN and LIN bus can cause communication failures. To prevent reflections, termination can be present as external resistance or resistance the XNET CAN or LIN board applies internally. This property determines whether the XNET board uses termination to the bus. For further information about appropriate terminations of a CAN or LIN network, refer to the NI-XNET Hardware and Software Manual. The default is 0. | ||||||||
| 16 | Timeout RspPending is the timeout in milliseconds the master waits for the response to a diagnostic request message after receiving an RspPending Negative Response Message (0x78). The default is 1000 ms. This is the P2* timeout from the ISO 15765-3 specification. | ||||||||
| 17 | LIN Sleep is available for LIN only and controls the sleep state of the LIN bus. Allowed values are:
|
||||||||
| 18 | Actual CAN IO Mode returns the CAN IO Mode used for communication to the ECU. This is typically the same as the ioMode parameter of ndOpenDiagnosticOnCANFD. However, if ECU Determined is chosen, then Actual CAN IO Mode returns the mode actually used. | ||||||||
| 19 | Response Plausibility Check defines whether the first byte of the diagnostic response is checked to contain the + 0x40 offset (positive response) or whether the first byte is 0x7F (negative response).
The default is 1, which is compatible with previous versions of the Automotive Diagnostic Command Set. Set this property to 0 only if you use non-standard diagnostic services. |
||||||||
| 20 | Session-based properties specifies whether the following ISO TP (15765-2) and DoIP properties are shared globally or apply only to the specific diagnostic session:
|
||||||||
| 21 | DoIP Acknowledge Mode returns the DoIP Diagnostic Message Acknowledgement behavior.
|
Output
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.
propertyValue
The requested property value.
DescriptionUse this function to request several internal diagnostic parameters, such as timeouts for the transport protocol. Use ndDiagSetProperty to modify the parameters.