ndUDSCommunicationControl
- Updated2025-10-07
- 2 minute(s) read
Purpose
Executes the UDS CommunicationControl service. Switches transmission and/or reception of the normal communication messages (usually CAN messages) on or off.
Format
long ndUDSCommunicationControl(
TD1 *diagRef,
unsigned char type,
unsigned char communicationType,
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.
type
Indicates whether transmission/reception is to be switched on/off. The usual values are:
00: enableRxAndTx
01: enableRxAndDisableTx
02: disableRxAndEnableTx
03: disableRxAndTx
communicationType
A bitfield indicating which application level is to be changed. The usual values are:
01: application
02: networkManagement
You can change more than one level at a time. 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.
DescriptionThis function executes the UDS CommunicationControl service and switches transmission and/or reception of the normal communication messages (usually CAN messages) on or off. The type and communication type parameters are vehicle manufacturer specific (one OEM may disable the transmission only, while another OEM may disable the transmission and reception based on vehicle manufacturer specific needs). The request is either transmitted functionally addressed to all ECUs with a single request message, or transmitted physically addressed to each ECU in a separate request message.