TestWaitForJ1939DTC
Valid for: CANoe DE • CANoe4SW DEFunction Syntax
long TestWaitForJ1939DTC (dword sourceAddress, Message message, dword spn, dword timeout); // form 1long TestWaitForJ1939DTC (dword sourceAddress, dword pgn, dword spn, dword timeout); // form 2long TestWaitForJ1939DTC (Node node, Message message, dword spn, dword timeout); // form 3long TestWaitForJ1939DTC (Node node, dword pgn, dword spn, dword timeout); // form 4long TestWaitForJ1939DTC (dword sourceAddress, Message message, dword spn, word fmi, word oc, dword timeout); // form 5long TestWaitForJ1939DTC (dword sourceAddress, dword pgn, dword spn, word fmi, word oc, dword timeout); // form 6long TestWaitForJ1939DTC (Node node, Message message, dword spn, word fmi, word oc, dword timeout); // form 7long TestWaitForJ1939DTC (Node node, dword pgn, dword spn, word fmi, word oc, dword timeout); // form 8
Description
Waits until a defined Parameter Group and a defined Diagnostic Trouble Code (DTC) is received or a timeout occurred. The affected message (specified by the Parameter Group number pgn or the database object message) must be able to contain a DTC, so only this parameter groups are allowed: DM1, DM2, DM4, DM6, DM12, DM23, DM24, DM27, DM28, DM31, DM35 and DM41-DM54. To get the message content of the parameter group which triggered the wait condition you can use the function TestGetWaitJ1939PGData. Note: Dependent on the used parameter type the appropriate bus context in a multibus environment has only to be set before the function is called if the corresponding database object will be ambiguous. Further information on site MultiBus Environment.Parameters
- message: Message containing the specified DTC. Must be a J1939 Parameter Group.
- pgn: Parameter Group Number (with data page) of the message containing the specified DTC.
- node: Sender of the message containing the specified DTC.
- sourceAddress: Source address of the message containing the specified DTC.
0xFFFFFFFFif source address is to be ignored. - spn: Suspect Parameter Number of the specified DTC.
0xFFFFFFFFif spn is to be ignored. - fmi: Failure Mode Identifier of the specified DTC.
0xFFFFif fmi is to be ignored. - oc: Occurrence Counter of the specified DTC.
0xFFFFif oc is to be ignored. - timeout: Maximum time to wait [ms]. 0 if timeout is to be ignored.
Return Values
- -2: Resume due to constraint violation
- -1: General error, for example, functionality is not available
- 0: Resume due to timeout
- 1: Resume due to event occurred